* Use dict.get in lemmatizer

This commit is contained in:
Matthew Honnibal 2015-09-10 14:51:39 +02:00
parent e7e529edf4
commit 7c660c5efc
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ class Lemmatizer(object):
pos = 'verb' pos = 'verb'
elif pos == ADJ: elif pos == ADJ:
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 return lemmas
def noun(self, string): def noun(self, string):