mirror of https://github.com/explosion/spaCy.git
Fix pos name conflict with morphology
This commit is contained in:
parent
8e7df3c4ca
commit
35cd953f9e
|
@ -37,15 +37,15 @@ class Lemmatizer(object):
|
||||||
self.exc = exceptions
|
self.exc = exceptions
|
||||||
self.rules = rules
|
self.rules = rules
|
||||||
|
|
||||||
def __call__(self, string, pos, **morphology):
|
def __call__(self, string, univ_pos, **morphology):
|
||||||
if pos == NOUN:
|
if univ_pos == NOUN:
|
||||||
pos = 'noun'
|
univ_pos = 'noun'
|
||||||
elif pos == VERB:
|
elif univ_pos == VERB:
|
||||||
pos = 'verb'
|
univ_pos = 'verb'
|
||||||
elif pos == ADJ:
|
elif univ_pos == ADJ:
|
||||||
pos = 'adj'
|
univ_pos = 'adj'
|
||||||
elif pos == PUNCT:
|
elif univ_pos == PUNCT:
|
||||||
pos = 'punct'
|
univ_pos = 'punct'
|
||||||
# See Issue #435 for example of where this logic is requied.
|
# See Issue #435 for example of where this logic is requied.
|
||||||
if self.is_base_form(pos, **morphology):
|
if self.is_base_form(pos, **morphology):
|
||||||
return set([string.lower()])
|
return set([string.lower()])
|
||||||
|
|
Loading…
Reference in New Issue