mirror of
https://github.com/fxsjy/jieba.git
synced 2025-07-10 00:01:33 +08:00
try to fix this issue: https://github.com/fxsjy/jieba/issues/26
This commit is contained in:
parent
8d8e50fbf9
commit
1edc1651ee
@ -50,7 +50,8 @@ if load_from_cache_fail:
|
||||
FREQ = dict([(k,log(float(v)/total)) for k,v in FREQ.iteritems()]) #normalize
|
||||
min_freq = min(FREQ.itervalues())
|
||||
print >> sys.stderr, "dumping model to file cache"
|
||||
marshal.dump((trie,FREQ,total,min_freq),open(cache_file,'wb'))
|
||||
marshal.dump((trie,FREQ,total,min_freq),open(cache_file+".tmp",'wb'))
|
||||
os.rename(cache_file+".tmp",cache_file)
|
||||
|
||||
print >> sys.stderr, "loading model cost ", time.time() - t1, "seconds."
|
||||
print >> sys.stderr, "Trie has been built succesfully."
|
||||
|
Loading…
x
Reference in New Issue
Block a user