文章会有【原创】或者【转载】标示,部分来自Google Baidu的学习结果 {Java/PHP/Python/Ruby/Go}

Python 分词【原创】  


项目地址:https://github.com/fxsjy/jieba

wget http://yang.u85.us/jieba-0.19.zip


unzip jieba-0.19.zip


cd jieba-0.19/


python setup.py install


t.py


# -*- coding: utf-8 -*-
import jieba

seg_list = jieba.cut("侯惠阳phper.yang来到北京清华大学",cut_all=True)
print "Full Mode:", "/ ".join(seg_list) #全模式

seg_list = jieba.cut("侯惠阳phper.yang来到北京清华大学",cut_all=False)
print "Default Mode:", "/ ".join(seg_list) #默认模式

seg_list = jieba.cut("侯惠阳phper.yang来到了北京小米科技")
print ", ".join(seg_list)



jieba.pdf.zip(67.3 KB)