continue
tup = line.split(" ")
word, freq = tup[0], tup[1]
if freq.isdigit() is False:
continue
if line_no == 1:
word = word.replace("\ufeff","") //remove bom flag if it exists
add_word(*tup)
After Change
if not line.rstrip():
continue
tup = line.strip().split(" ")
if tup[1].isdigit():
add_word(*tup)
@require_initialized
def add_word(word, freq, tag=None):
global FREQ, pfdict, total, user_word_tag_tab
freq = int(freq)