* Fix loading of special morph words

This commit is contained in:
Matthew Honnibal 2015-01-03 23:13:00 +11:00
parent a6f3c0c329
commit 0e4c2ba036

View File

@ -243,8 +243,9 @@ cdef class EnPosTagger:
self.tags[i].id = i self.tags[i].id = i
self.tags[i].pos = pos self.tags[i].pos = pos
set_morph_from_dict(&self.tags[i].morph, props) set_morph_from_dict(&self.tags[i].morph, props)
if path.exists(path.join(data_dir, 'morphs.json')): if path.exists(path.join(data_dir, 'tokenizer', 'morphs.json')):
self.load_morph_exceptions(json.load(open(path.join(data_dir, 'morphs.json')))) self.load_morph_exceptions(json.load(open(path.join(data_dir, 'tokenizer',
'morphs.json'))))
self.lemmatizer = Lemmatizer(path.join(data_dir, 'wordnet'), NOUN, VERB, ADJ) self.lemmatizer = Lemmatizer(path.join(data_dir, 'wordnet'), NOUN, VERB, ADJ)
def __call__(self, Tokens tokens): def __call__(self, Tokens tokens):