mirror of
https://github.com/explosion/spaCy.git
synced 2025-06-11 00:23:07 +03:00
Lemmatizer honors exceptions: Fix #1387
This commit is contained in:
parent
e81a608173
commit
ffb50d21a0
|
@ -78,6 +78,7 @@ def lemmatize(string, index, exceptions, rules):
|
||||||
# forms.append(string)
|
# forms.append(string)
|
||||||
forms.extend(exceptions.get(string, []))
|
forms.extend(exceptions.get(string, []))
|
||||||
oov_forms = []
|
oov_forms = []
|
||||||
|
if not forms:
|
||||||
for old, new in rules:
|
for old, new in rules:
|
||||||
if string.endswith(old):
|
if string.endswith(old):
|
||||||
form = string[:len(string) - len(old)] + new
|
form = string[:len(string) - len(old)] + new
|
||||||
|
|
Loading…
Reference in New Issue
Block a user