fix indent typo

This commit is contained in:
Dingyuan Wang 2014-09-06 23:37:54 +08:00
parent 6fad5fbb2c
commit b16cf0d63f

View File

@ -24,13 +24,13 @@ def set_idf_path(idf_path):
def get_idf(abs_path): def get_idf(abs_path):
content = open(abs_path,'rb').read().decode('utf-8') content = open(abs_path,'rb').read().decode('utf-8')
idf_freq = {} idf_freq = {}
lines = content.split('\n') lines = content.split('\n')
for line in lines: for line in lines:
word,freq = line.split(' ') word,freq = line.split(' ')
idf_freq[word] = float(freq) idf_freq[word] = float(freq)
median_idf = sorted(idf_freq.values())[len(idf_freq)/2] median_idf = sorted(idf_freq.values())[len(idf_freq)/2]
return idf_freq, median_idf return idf_freq, median_idf
def set_stop_words(stop_words_path): def set_stop_words(stop_words_path):
global STOP_WORDS global STOP_WORDS