Say re-tweets

merge-requests/30/head
Bob Mottram 2021-03-02 14:05:43 +00:00
parent 19e3b45c3f
commit 16cf56d87a
1 changed files with 5 additions and 2 deletions

View File

@ -45,6 +45,7 @@ def speakerPronounce(baseDir: str, sayText: str, translate: {}) -> str:
"Epicyon": "Epi-cyon", "Epicyon": "Epi-cyon",
"espeak": "e-speak", "espeak": "e-speak",
"clearnet": "clear-net", "clearnet": "clear-net",
"RT @": "Re-Tweet ",
"#": translate["hashtag"], "#": translate["hashtag"],
":)": translate["smile"], ":)": translate["smile"],
";)": translate["wink"], ";)": translate["wink"],
@ -89,11 +90,13 @@ def speakerReplaceLinks(sayText: str, translate: {},
replacements = {} replacements = {}
wordsList = text.split(' ') wordsList = text.split(' ')
linkedStr = translate['Linked'] linkedStr = translate['Linked']
prevWord = ''
for word in wordsList: for word in wordsList:
# replace mentions # replace mentions, but not re-tweets
if word.startswith('@'): if word.startswith('@') and prevWord != 'RT':
replacements[word] = \ replacements[word] = \
translate['mentioning'] + ' ' + word[1:] + ',' translate['mentioning'] + ' ' + word[1:] + ','
prevWord = word
domain = None domain = None
domainFull = None domainFull = None