mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 10:46:29 +03:00
Also accept MorphAnalysis in set_morph
This commit is contained in:
parent
77e08c398f
commit
65dfaa4f4b
|
@ -225,6 +225,8 @@ cdef class Token:
|
||||||
cdef hash_t key
|
cdef hash_t key
|
||||||
if features is None:
|
if features is None:
|
||||||
self.c.morph = 0
|
self.c.morph = 0
|
||||||
|
elif isinstance(features, MorphAnalysis):
|
||||||
|
self.morph = features
|
||||||
else:
|
else:
|
||||||
if isinstance(features, int):
|
if isinstance(features, int):
|
||||||
features = self.vocab.strings[features]
|
features = self.vocab.strings[features]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user