分词实例
import jieba
import jieba.analyse
import jieba.posseg
def dosegment_al(sentence):
"""
带词性标注,对句子进行分词,不排除停词等
"""
sentence_seged = jieba.posseg.cut(sentence.strip())
outStr = ''
for x in setence_seged:
outStr += "{}/{}".format(x.world,x.flag)
return outStr