源码如下: import jieba import io import re #jieba.load_userdict("E:/xinxi2.txt") patton=re.compile(r'..') #添加字典 def add_dict(): f=open("E:/xinxi2.txt","r+",encoding="utf-8") #百度爬取的字典 for line in f: jieba.suggest_freq(li
文章转载:http://blog.csdn.net/xiaoxiangzi222/article/details/53483931 jieba “结巴”中文分词:做最好的 Python 中文分词组件 "Jieba" (Chinese for "to stutter") Chinese text segmentation: built to be the best Python Chinese word segmentation module. Scroll down