added list of intact words and changed capitalisation rules

This commit is contained in:
Your Name 2021-01-24 15:48:39 +01:00
parent 3272d367b9
commit d3e6b954fe
3 changed files with 6 additions and 0 deletions

5
api.py
View File

@ -50,6 +50,8 @@ def build_word_dict():
for y in range(len(current)):
charNeeded = current[y]
for item in wordList:
if item not in intact:
item = item.lower()
if (len(item)-1) >= y:
addKey = str(y) + item[y]
if addKey not in toChooseFrom.keys():
@ -185,8 +187,11 @@ def api_args():
testKey = str(y) + current[y]
# print(current[y],random.choice(toChooseFrom[testKey]))
api_phrase.append(random.choice(toChooseFrom[testKey]))
api_phrase[0] = api_phrase[0].capitalize()
api_phrase_str_word = ' '.join(api_phrase)
print('api_phrase_str_word: ',api_phrase_str_word)
api_phrase_str = api_phrase_str + '\\n' + api_phrase_str_word
print('api_phrase_str: ',api_phrase_str)
api_phrase_str_word = ''
api_phrase_str = api_phrase_str[2:]

1
intact_words.py Normal file
View File

@ -0,0 +1 @@
intact = ["Black","Indigenous"]

Binary file not shown.