diff --git a/spacy/lemmatizer.py b/spacy/lemmatizer.py index 312c8db72..700c7b8ea 100644 --- a/spacy/lemmatizer.py +++ b/spacy/lemmatizer.py @@ -100,3 +100,18 @@ def lemmatize(string, index, exceptions, rules): if not forms: forms.append(string) return set(forms) + + +class LookupLemmatizer(Lemmatizer): + @classmethod + def load(cls, path, lookup): + return cls(lookup or {}) + + def __init__(self, lookup): + self.lookup = lookup + + def __call__(self, string, univ_pos, morphology=None): + try: + return set([self.lookup[string]]) + except: + return set([string]) diff --git a/spacy/lemmatizerlookup.py b/spacy/lemmatizerlookup.py deleted file mode 100644 index 0c0c693c1..000000000 --- a/spacy/lemmatizerlookup.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding: utf8 -from __future__ import unicode_literals - -from .lemmatizer import Lemmatizer - - -class Lemmatizer(Lemmatizer): - @classmethod - def load(cls, path, lookup): - return cls(lookup or {}) - - def __init__(self, lookup): - self.lookup = lookup - - def __call__(self, string, univ_pos, morphology=None): - try: - return set([self.lookup[string]]) - except: - return set([string]) \ No newline at end of file