import jieba
import sys
import importlib
#importlib.reload(sys)
#sys.setdefaultencoding( "utf-8" )
file = 'jiebatest.txt'
fn = open(file,'r')
print(fn.read())
fn.close
import jieba.posseg as pseg
#import re
filename='result.txt'
fileneedCut='jiebatest.txt'
fn=open(fileneedCut,"r")
f=open(filename,"w+")
importlib.reload(sys)
for line in fn.readlines():
words=pseg.cut(line)
for w in words:
print (str(w))
f.close()
fn.close()
jieba分词
最新推荐文章于 2024-11-05 15:28:12 发布