mirror of
https://github.com/fxsjy/jieba.git
synced 2025-07-10 00:01:33 +08:00
fix a bug caused by default argument binding
This commit is contained in:
parent
ae15492257
commit
35aa38ed12
@ -44,8 +44,12 @@ def gen_trie(f_name):
|
|||||||
raise e
|
raise e
|
||||||
return trie, lfreq,ltotal
|
return trie, lfreq,ltotal
|
||||||
|
|
||||||
def initialize(dictionary=DICTIONARY):
|
def initialize(*args):
|
||||||
global trie, FREQ, total, min_freq, initialized
|
global trie, FREQ, total, min_freq, initialized
|
||||||
|
if len(args)==0:
|
||||||
|
dictionary = DICTIONARY
|
||||||
|
else:
|
||||||
|
dictionary = args[0]
|
||||||
with DICT_LOCK:
|
with DICT_LOCK:
|
||||||
if initialized:
|
if initialized:
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user