mirror of https://github.com/fxsjy/jieba.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
365 B
Python
22 lines
365 B
Python
import urllib2
|
|
import sys,time
|
|
import sys
|
|
sys.path.append("../../")
|
|
import jieba
|
|
|
|
jieba.enable_parallel()
|
|
|
|
url = sys.argv[1]
|
|
content = open(url,"rb").read()
|
|
t1 = time.time()
|
|
words = "/ ".join(jieba.cut(content))
|
|
|
|
t2 = time.time()
|
|
tm_cost = t2-t1
|
|
|
|
log_f = open("1.log","wb")
|
|
log_f.write(words.encode('utf-8'))
|
|
|
|
print 'speed' , len(content)/tm_cost, " bytes/second"
|
|
|