Python中文分词工具myjieba.py
# Python中文分词工具myjieba.py
import jieba
def cut_sentence(sentence):
"""
对句子进行分词
"""
words = jieba.cut(sentence)
return words
if __name__ == "__main__":
sentence = "我爱自然语言处理"
words = cut_sentence(sentence)
print("/".join(words))
下载地址
用户评论