mirror of https://github.com/explosion/spaCy.git
* Fix encoding in lemmatization
This commit is contained in:
parent
b132b3caa6
commit
94034f1112
|
@ -298,10 +298,10 @@ cdef class EnPosTagger:
|
||||||
if pos != NOUN and pos != VERB and pos != ADJ:
|
if pos != NOUN and pos != VERB and pos != ADJ:
|
||||||
return lex.sic
|
return lex.sic
|
||||||
cdef set lemma_strings
|
cdef set lemma_strings
|
||||||
cdef bytes lemma_string
|
cdef unicode lemma_string
|
||||||
lemma_strings = self.lemmatizer(py_string, pos)
|
lemma_strings = self.lemmatizer(py_string.decode('utf8'), pos)
|
||||||
lemma_string = sorted(lemma_strings)[0]
|
lemma_string = sorted(lemma_strings)[0]
|
||||||
lemma = self.strings.intern(lemma_string, len(lemma_string)).i
|
lemma = self.strings.intern(lemma_string.encode('utf8'), len(lemma_string)).i
|
||||||
return lemma
|
return lemma
|
||||||
|
|
||||||
def load_morph_exceptions(self, dict exc):
|
def load_morph_exceptions(self, dict exc):
|
||||||
|
|
Loading…
Reference in New Issue