|
|
@ -119,20 +119,22 @@ def api_args(): |
|
|
|
if 'rq' in request.args: |
|
|
|
rqstr = str(request.args['rq']) |
|
|
|
if rqstr == "generate": |
|
|
|
# Create an empty list for our results |
|
|
|
results = [] |
|
|
|
api_phrase = [] |
|
|
|
|
|
|
|
api_phrase_str = '' |
|
|
|
for i in range(len(seedTextList)): |
|
|
|
# Current word in the seed phrase |
|
|
|
current = seedTextList[i] |
|
|
|
# Going through the letters in the above word |
|
|
|
api_phrase = [] |
|
|
|
for y in range(len(current)): |
|
|
|
testKey = str(y) + current[y] |
|
|
|
# print(current[y],random.choice(toChooseFrom[testKey])) |
|
|
|
api_phrase.append(random.choice(toChooseFrom[testKey])) |
|
|
|
api_phrase_str = ' \n '.join(api_phrase) |
|
|
|
results.append(api_phrase_str) |
|
|
|
|
|
|
|
api_phrase_str_word = ' '.join(api_phrase) |
|
|
|
api_phrase_str = api_phrase_str + '\\n' + api_phrase_str_word |
|
|
|
api_phrase_str_word = '' |
|
|
|
api_phrase_str = api_phrase_str[2:] |
|
|
|
print(api_phrase_str) |
|
|
|
for elem in refWords: |
|
|
|
if elem in api_phrase: |
|
|
|
count +=1 |
|
|
|