mirror of
https://github.com/fxsjy/jieba.git
synced 2025-07-10 00:01:33 +08:00
Merge branch 'master' into jieba3k
This commit is contained in:
commit
4eca1a2f47
@ -82,7 +82,8 @@ def initialize(*args):
|
|||||||
min_freq = min(FREQ.values())
|
min_freq = min(FREQ.values())
|
||||||
print("dumping model to file cache " + cache_file, file=sys.stderr)
|
print("dumping model to file cache " + cache_file, file=sys.stderr)
|
||||||
tmp_suffix = "."+str(random.random())
|
tmp_suffix = "."+str(random.random())
|
||||||
marshal.dump((trie,FREQ,total,min_freq),open(cache_file+tmp_suffix,'wb'))
|
with open(cache_file+tmp_suffix,'wb') as temp_cache_file:
|
||||||
|
marshal.dump((trie,FREQ,total,min_freq),temp_cache_file)
|
||||||
if os.name=='nt':
|
if os.name=='nt':
|
||||||
import shutil
|
import shutil
|
||||||
replace_file = shutil.move
|
replace_file = shutil.move
|
||||||
|
Loading…
x
Reference in New Issue
Block a user