mirror of https://github.com/fxsjy/jieba.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
337 B
Python
17 lines
337 B
Python
12 years ago
|
#encoding=utf-8
|
||
|
import sys
|
||
|
sys.path.append("../")
|
||
|
import jieba
|
||
|
jieba.load_userdict("userdict.txt")
|
||
|
import jieba.posseg as pseg
|
||
|
|
||
|
test_sent = "李小福是创新办主任也是云计算方面的专家"
|
||
|
words = jieba.cut(test_sent)
|
||
|
for w in words:
|
||
12 years ago
|
print(w)
|
||
12 years ago
|
|
||
|
result = pseg.cut(test_sent)
|
||
|
|
||
|
for w in result:
|
||
12 years ago
|
print(w.word, "/", w.flag, ", ")
|