mirror of
https://github.com/explosion/spaCy.git
synced 2025-06-24 23:13:04 +03:00
Update __init__.py
Set the "cut_all" parameter to False, or jieba will return ALL POSSIBLE word segmentations.
This commit is contained in:
parent
ddaff6ca56
commit
7692b8c071
|
@ -7,6 +7,6 @@ class Chinese(Language):
|
||||||
|
|
||||||
def make_doc(self, text):
|
def make_doc(self, text):
|
||||||
import jieba
|
import jieba
|
||||||
words = list(jieba.cut(text, cut_all=True))
|
words = list(jieba.cut(text, cut_all=False))
|
||||||
words=[x for x in words if x]
|
words=[x for x in words if x]
|
||||||
return Doc(self.vocab, words=words, spaces=[False]*len(words))
|
return Doc(self.vocab, words=words, spaces=[False]*len(words))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user