Also accept MorphAnalysis in set_morph

This commit is contained in:
Adriane Boyd 2020-10-02 08:33:43 +02:00
parent 77e08c398f
commit 65dfaa4f4b

View File

@ -225,6 +225,8 @@ cdef class Token:
cdef hash_t key
if features is None:
self.c.morph = 0
elif isinstance(features, MorphAnalysis):
self.morph = features
else:
if isinstance(features, int):
features = self.vocab.strings[features]