Skip to content

Commit

Permalink
update dict and change some code in main
Browse files Browse the repository at this point in the history
  • Loading branch information
D3vKn1ght committed May 2, 2022
1 parent 5195997 commit 2ddc147
Show file tree
Hide file tree
Showing 6 changed files with 1,953 additions and 6 deletions.
1,945 changes: 1,945 additions & 0 deletions dict.csv

Large diffs are not rendered by default.

Binary file modified dict.npy
Binary file not shown.
Binary file modified dictEV.mobi
Binary file not shown.
2 changes: 1 addition & 1 deletion dictToMobi.ps1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python .\penelope\bin\penelope -i .\dict.csv -j csv -p mobi -f en -t ve --title "Eng-Viet Google Translate"-o dictEV --kindlegen-path "kindlegen.exe"
python .\penelope\bin\penelope -i .\dict.csv -j csv -p mobi -f en -t ve --title "EV Translate by Trung Tran"-o dictEV --kindlegen-path "kindlegen.exe"
12 changes: 7 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
continue
if resultGoogle != word:
add += 1

else:
continue
try:
resultBing = bingTranslate.translate(word)
resultBing = resultBing.lower().strip()
Expand All @@ -71,6 +72,7 @@
continue
if resultMyMemory != word:
add += 1
dem += 1
if check == False or add < 2:
continue
trans = "Google: "+resultGoogle+"\tBing: " + \
Expand All @@ -88,9 +90,9 @@
value += "<b>- MyMemory :</b><br />&emsp;+ {0}<br/>".format(
resultMyMemory.lower().strip().capitalize())
value += "</div>"
dct[word] = value
dem += 1
if dem % 10 == 0:
dct[word] = value
if dem % 30 == 0:
np.save(nameDict, dct)
print("SAVE IN DICT")
time.sleep(random.randint(5, 10))
print("Hien co ", len(dct), "tu")
time.sleep(random.randint(20, 30))
File renamed without changes.

0 comments on commit 2ddc147

Please sign in to comment.