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