Created
March 19, 2013 03:38
-
-
Save baojie/5193537 to your computer and use it in GitHub Desktop.
Example from https://github.com/fxsjy/jieba
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#encoding=utf-8 | |
import jieba | |
seg_list = jieba.cut("我来到北京清华大学",cut_all=True) | |
print "Full Mode:", "/ ".join(seg_list) #全模式 | |
seg_list = jieba.cut("我来到北京清华大学",cut_all=False) | |
print "Default Mode:", "/ ".join(seg_list) #精确模式 | |
seg_list = jieba.cut("他来到了网易杭研大厦") | |
print ", ".join(seg_list) | |
seg_list = jieba.cut_for_search("小明硕士毕业于中国科学院计算所,后在日本京都大学深造") #搜索引擎模式 | |
print ", ".join(seg_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment