# - * - coding: utf-8 - * -
The import jieba
The import jieba. Analyse
Jieba. Load_userdict (" userdict1. TXT ")
Jieba. Analyse. Set_stop_words (" extra_dict/stop_words. TXT ")
Def splitSentence (inputFile outputFile) :
Fin=open (aa, 'r', encoding="utf-8")
Fout=open (bb, 'w', encoding="utf-8")
For the line in fin:
The line=line. Strip ()
The line=jieba. Analyse. Extract_tags (line)
Outstr="". Join (line)
Print (outstr)
Fout. Write (outstr + '\ n')
Fin. The close ()
Fout. Close ()
SplitSentence (' input. TXT ', 'output. TXT)
In this way, every time always tip ImportError: No module named analyse, strives for the big help!
CodePudding user response:
Jieba not installed well, are you sure you install version is right?
CodePudding user response: