mirror of
https://github.com/kaiyuran/Emoji-translator-Server.git
synced 2024-11-25 18:43:47 +00:00
small changes to fix output
This commit is contained in:
parent
7622d8c68e
commit
f2a23ebc5b
1 changed files with 3 additions and 4 deletions
7
app.py
7
app.py
|
@ -186,18 +186,17 @@ def emojify(message):
|
|||
try:
|
||||
formWord = word.lower()
|
||||
if formWord[-1] == ".":
|
||||
finalMessage.append(word[:-1] + choiceWordDict[formWord[:-1]]+".")
|
||||
finalMessage.append(word[:-1] + (choiceWordDict[formWord[:-1]] * random.randint(1,3)) +".")
|
||||
else:
|
||||
finalMessage.append(word + choiceWordDict[word.lower()])
|
||||
|
||||
|
||||
# print("Emojified word is:",word)
|
||||
|
||||
except:
|
||||
finalMessage.append(word)
|
||||
pass
|
||||
print(finalMessage)
|
||||
final =" ".join([str(item) for item in finalMessage])
|
||||
# print(final)
|
||||
return final
|
||||
|
||||
|
||||
|
@ -216,7 +215,7 @@ def get_random_emoji():
|
|||
|
||||
|
||||
final = emojify(message)
|
||||
print(final)
|
||||
# print(final)
|
||||
final = jsonify({"message": final})# emoji in JSON format
|
||||
# final = jsonify({final: 1})# emoji in JSON format
|
||||
|
||||
|
|
Loading…
Reference in a new issue