Skip to content

Commit

Permalink
surface_to_key_stem dict actually stores rule object now
Browse files Browse the repository at this point in the history
  • Loading branch information
jtauber committed Apr 26, 2016
1 parent 3253f1c commit b7d283f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inflexion/stemming.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self):
def add(self, key, rule):
r = SandhiRule(rule)
self.key_to_rules[key].append(r)
self.surface_to_key_stem[r.surface].add((key, r.stem))
self.surface_to_key_stem[r.surface].add((key, r))
return r

def inflect(self, stem, key):
Expand Down Expand Up @@ -47,5 +47,5 @@ def inflect(self, stem, key):
def possible_stems(self, form):
for surface, rules in self.surface_to_key_stem.items():
if form.endswith(surface):
for key, stem_ending in rules:
yield (key, form[:-len(surface)] + stem_ending)
for key, rule in rules:
yield (key, form[:-len(surface)] + rule.stem)

0 comments on commit b7d283f

Please sign in to comment.