mirror of https://github.com/fxsjy/jieba.git
improve POS tagging
parent
7612a62115
commit
90cd4b3014
@ -0,0 +1,2 @@
|
|||||||
|
西三旗硅谷先锋小区半地下室出租,便宜可合租硅谷
|
||||||
|
工信处女干事每月经过下属科室都要亲口交代24口交换机等技术性器件的安装工作
|
@ -0,0 +1,20 @@
|
|||||||
|
import urllib2
|
||||||
|
import sys,time
|
||||||
|
import sys
|
||||||
|
sys.path.append("../")
|
||||||
|
import jieba
|
||||||
|
|
||||||
|
url = sys.argv[1]
|
||||||
|
content = open(url,"rb").read()
|
||||||
|
t1 = time.time()
|
||||||
|
words = list(jieba.cut(content))
|
||||||
|
|
||||||
|
t2 = time.time()
|
||||||
|
tm_cost = t2-t1
|
||||||
|
|
||||||
|
log_f = open("1.log","wb")
|
||||||
|
for w in words:
|
||||||
|
print >> log_f, w.encode("gbk"), "/" ,
|
||||||
|
|
||||||
|
print 'speed' , len(content)/tm_cost, " bytes/second"
|
||||||
|
|
@ -0,0 +1,20 @@
|
|||||||
|
import urllib2
|
||||||
|
import sys,time
|
||||||
|
import sys
|
||||||
|
sys.path.append("../")
|
||||||
|
import jieba.posseg as pseg
|
||||||
|
|
||||||
|
url = sys.argv[1]
|
||||||
|
content = open(url,"rb").read()
|
||||||
|
t1 = time.time()
|
||||||
|
words = list(pseg.cut(content))
|
||||||
|
|
||||||
|
t2 = time.time()
|
||||||
|
tm_cost = t2-t1
|
||||||
|
|
||||||
|
log_f = open("1.log","wb")
|
||||||
|
for w in words:
|
||||||
|
print >> log_f, w.encode("gbk"), "/" ,
|
||||||
|
|
||||||
|
print 'speed' , len(content)/tm_cost, " bytes/second"
|
||||||
|
|
Loading…
Reference in New Issue