--------------------------------------------------------
参考:http://blog.csdn.net/reallocing1/article/details/51694967
--------------------------------------------------------
配置:windows +python 3.6.3 + jieba(pip install jieba)+bottle(pip install bottle)+webbrowser+cmd
--------------------------------------------------------
import jieba
import webbrowser
from bottle import template
with open('C:/users/d/desktop/a/1.txt','r')as f:
for line in f:
seg = jieba.cut(line.strip(),cut_all = False)
output ='/'.join(seg)
with open('C:/users/d/desktop/a/test.html','a+b')as s:
s.write(output.encode('utf-8'))
126
269
171
198
0
webbrowser.open('C:/users/d/desktop/a/test.html')
True
---------------------------------------------------
>>> import jieba
>>> import webbrowser
>>> from bottle import template
>>> with open('C:/users/d/desktop/a/1.txt','r')as f:
... for line in f:... seg = jieba.cut(line.strip(),cut_all = False)
... output ='/'.join(seg)
... with open('C:/users/d/desktop/a/test.html','a+b')as s:
... s.write(output.encode('utf-8'))
...
>>> webbrowser.open('C:/users/d/desktop/a/test.html')
True
---------------------------------------------------
接下来就是,分句了
然后,就是定位了