Skip to content

Commit

Permalink
Approve All added
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Aug 2, 2021
1 parent 07bc692 commit 3f5b415
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions utils/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,29 @@
try:
quote_file = open("./assets/json/morequotes.json", "r")
except:
quotes = {"วาทกรรมสลิ่ม":[]}
quotes = {"วาทกรรมสลิ่ม": []}
else:
quotes = json.load(quote_file)

mode = int(input("Approve Mode [1 for One by One or 0 for Approve All]"))

with open("./utils/train.txt") as train_data:
train_quotes = train_data.readlines()
for q in train_quotes:
q = q[:-1]
print(q)
choice = input("APPROVE? [Y for Yes, otherwise any key] => ")
if (choice[0] == 'Y' or choice[0] == 'y'):
if mode:
choice = input("APPROVE? [Y for Yes, otherwise any key] => ")
if (choice[0] == 'Y' or choice[0] == 'y'):
quotes["วาทกรรมสลิ่ม"].append(q)
else:
quotes["วาทกรรมสลิ่ม"].append(q)
print()

if len(train_quotes) <= 0:
print("Nothing to train here! Come back later!")
exit()

with open("./assets/json/morequotes.json", "w") as outfile:
final_str = str(quotes)
final_str = final_str.replace('"', '\\"')
Expand Down

0 comments on commit 3f5b415

Please sign in to comment.