From 9b90d235d111a87b50e46c92431d0412d9e5a8c1 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 12 Oct 2017 22:50:43 +0200 Subject: [PATCH] Fix tag check in lemmatizer --- spacy/lemmatizer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spacy/lemmatizer.py b/spacy/lemmatizer.py index 1fb83a727..53519e4f1 100644 --- a/spacy/lemmatizer.py +++ b/spacy/lemmatizer.py @@ -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()])