parent
811f754738
commit
a1b5e5b049
Binary file not shown.
@ -0,0 +1,12 @@
|
|||||||
|
import jieba
|
||||||
|
from Config.Config import JIEBA_CUSTOM_WORDS
|
||||||
|
|
||||||
|
# 从配置文件加载自定义词典
|
||||||
|
for word in JIEBA_CUSTOM_WORDS:
|
||||||
|
jieba.add_word(word)
|
||||||
|
|
||||||
|
# 分词演示
|
||||||
|
text = "文言虚词"
|
||||||
|
print("默认模式:", list(jieba.cut(text)))
|
||||||
|
print("全模式:", list(jieba.cut(text, cut_all=True)))
|
||||||
|
print("搜索引擎模式:", list(jieba.cut_for_search(text)))
|
Loading…
Reference in new issue