fix regex not doing on the right string
This commit is contained in:
parent
850624329a
commit
b326fc151d
1 changed files with 1 additions and 1 deletions
2
main.py
2
main.py
|
@ -47,7 +47,7 @@ class Listener(StreamListener):
|
|||
tweet = status.text.lower()
|
||||
# recovery of the last "usable" word of the tweet
|
||||
tweetText = sub(r"https?:\/\/\S+| *\?+| *!+| *,+|-|~|\.+|…|\^+|@\S+" + f"|{emojis()}", " ", tweet) # deletion with space
|
||||
tweetText = sub(r"(?<=ui)i+|(?<=na)a+(?<!n)|(?<=quoi)i+|(?<=no)o+(?<!n)|(?<=hei)i+(?<!n)|(?<=si)i+", "", tweet) # deletion without space
|
||||
tweetText = sub(r"(?<=ui)i+|(?<=na)a+(?<!n)|(?<=quoi)i+|(?<=no)o+(?<!n)|(?<=hei)i+(?<!n)|(?<=si)i+", "", tweetText) # deletion without space
|
||||
lastWord = tweetText.split()[-1:][0]
|
||||
if keys["VERBOSE"]:
|
||||
print(f"Tweet trouvé de {status._json['user']['screen_name']} (dernier mot : \"{lastWord}\")...", end = " ")
|
||||
|
|
Reference in a new issue