return tuple of functions, not a list, in plural4

This commit is contained in:
Mark Pilgrim
2009-08-17 00:51:15 -04:00
parent 52a7502194
commit 0ae994814a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ def build_match_and_apply_functions(pattern, search, replace):
return re.search(pattern, word)
def apply_rule(word):
return re.sub(search, replace, word)
return [matches_rule, apply_rule]
return (matches_rule, apply_rule)
rules = []
with open('plural4-rules.txt', encoding='utf-8') as pattern_file:
+1 -1
View File
@@ -271,7 +271,7 @@ $ $ s</code></pre>
return re.search(pattern, word)
def apply_rule(word):
return re.sub(search, replace, word)
return [matches_rule, apply_rule]
return (matches_rule, apply_rule)
rules = []
<a>with open('plural4-rules.txt', encoding='utf-8') as pattern_file: <span class=u>&#x2461;</span></a>