fix a bug caused by default argument binding

This commit is contained in:
Sun Junyi 2013-04-28 12:04:16 +08:00
parent ae15492257
commit 35aa38ed12

View File

@ -44,8 +44,12 @@ def gen_trie(f_name):
raise e
return trie, lfreq,ltotal
def initialize(dictionary=DICTIONARY):
def initialize(*args):
global trie, FREQ, total, min_freq, initialized
if len(args)==0:
dictionary = DICTIONARY
else:
dictionary = args[0]
with DICT_LOCK:
if initialized:
return