1
0
Fork 0

Merge branch 'master' of http://121.4.94.30:3000/mrlan/EnglishPal into BugFix293

Lanhui-IncreaseChanceOfGettingDifficultArticles
Hui Lan 2021-08-31 21:27:37 +08:00
commit 2a509f83cc
3 changed files with 10 additions and 2 deletions

View File

@ -55,11 +55,17 @@ def get_difficulty_level(d1, d2):
def revert_dict(d): def revert_dict(d):
''' '''
In d2, time is the key, and the value is a list of words picked at that time. In d, word is the key, and value is a list of dates.
In d2 (the returned value of this function), time is the key, and the value is a list of words picked at that time.
''' '''
d2 = {} d2 = {}
for k in d: for k in d:
if type(d[k]) is list: # d[k] is a list of dates.
lst = d[k] lst = d[k]
elif type(d[k]) is int: # for backward compatibility. d was sth like {'word':1}. The value d[k] is not a list of dates, but a number representing how frequent this word had been added to the new word book.
freq = d[k]
lst = freq*['2021082019'] # why choose this date? No particular reasons. I fix the bug in this date.
for time_info in lst: for time_info in lst:
date = time_info[:10] # until hour date = time_info[:10] # until hour
if not date in d2: if not date in d2:

0
build.sh Executable file → Normal file
View File

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
Flask==1.1.2
selenium==3.141.0