Fix tag check in lemmatizer

This commit is contained in:
Matthew Honnibal 2017-10-12 22:50:43 +02:00
parent dc01acd821
commit 9b90d235d1

View File

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