From 7c660c5efc24d5c8940a25cd6569eaddb96d6deb Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 10 Sep 2015 14:51:39 +0200 Subject: [PATCH] * Use dict.get in lemmatizer --- spacy/lemmatizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/lemmatizer.py b/spacy/lemmatizer.py index dc8c2b03b..8d0046ea1 100644 --- a/spacy/lemmatizer.py +++ b/spacy/lemmatizer.py @@ -33,7 +33,7 @@ class Lemmatizer(object): pos = 'verb' elif pos == ADJ: pos = 'adj' - lemmas = lemmatize(string, self.index[pos], self.exc[pos], self.rules.get(pos, [])) + lemmas = lemmatize(string, self.index.get(pos, {}), self.exc.get(pos, {}), self.rules.get(pos, [])) return lemmas def noun(self, string):