mirror of
https://github.com/fxsjy/jieba.git
synced 2025-07-24 00:00:05 +08:00
fix indent typo
This commit is contained in:
parent
6fad5fbb2c
commit
b16cf0d63f
@ -24,9 +24,9 @@ def set_idf_path(idf_path):
|
||||
|
||||
def get_idf(abs_path):
|
||||
content = open(abs_path,'rb').read().decode('utf-8')
|
||||
idf_freq = {}
|
||||
lines = content.split('\n')
|
||||
for line in lines:
|
||||
idf_freq = {}
|
||||
lines = content.split('\n')
|
||||
for line in lines:
|
||||
word,freq = line.split(' ')
|
||||
idf_freq[word] = float(freq)
|
||||
median_idf = sorted(idf_freq.values())[len(idf_freq)/2]
|
||||
|
Loading…
x
Reference in New Issue
Block a user