Fix tag check in lemmatizer

This commit is contained in:
Matthew Honnibal 2017-10-12 22:50:43 +02:00
parent dc01acd821
commit 9b90d235d1
1 changed files with 4 additions and 4 deletions

View File

@ -17,13 +17,13 @@ class Lemmatizer(object):
self.lookup_table = lookup if lookup is not None else {}
def __call__(self, string, univ_pos, morphology=None):
if univ_pos == NOUN:
if univ_pos in (NOUN, 'NOUN', 'noun'):
univ_pos = 'noun'
elif univ_pos == VERB:
elif univ_pos in (VERB, 'VERB', 'verb'):
univ_pos = 'verb'
elif univ_pos == ADJ:
elif univ_pos in (ADJ, 'ADJ', 'adj'):
univ_pos = 'adj'
elif univ_pos == PUNCT:
elif univ_pos in (PUNCT, 'PUNCT', 'punct'):
univ_pos = 'punct'
else:
return set([string.lower()])