same for "non" and "quoi"
This commit is contained in:
parent
2e58763e7e
commit
258eaca327
1 changed files with 2 additions and 1 deletions
3
main.py
3
main.py
|
@ -34,7 +34,8 @@ class Listener(StreamListener):
|
||||||
if status._json["user"]["id"] in self.listOfFriendsID: # verification of the author of the tweet
|
if status._json["user"]["id"] in self.listOfFriendsID: # verification of the author of the tweet
|
||||||
if seniority(status._json["created_at"]): # verification of the age of the tweet
|
if seniority(status._json["created_at"]): # verification of the age of the tweet
|
||||||
# recovery of the last "usable" word of the tweet
|
# recovery of the last "usable" word of the tweet
|
||||||
tweetText = sub(r"https?:\/\/\S+| +?\?|\?| +?\!| ?\!|-|~|(?<=ui)i+|@\S+|\.+|(?<=na)a+(?<!n)", "", status._json["text"].lower())
|
regex = r"https?:\/\/\S+| +?\?|\?| +?\!| ?\!|-|~|(?<=ui)i+|@\S+|\.+|(?<=na)a+(?<!n)|(?<=quoi)i+|(?<=no)o+(?<!n)"
|
||||||
|
tweetText = sub(regex, "", status._json["text"].lower())
|
||||||
lastWord = tweetText.split()[-1:][0]
|
lastWord = tweetText.split()[-1:][0]
|
||||||
print(f"Tweet trouvé (dernier mot: \"{lastWord}\")...", end = " ")
|
print(f"Tweet trouvé (dernier mot: \"{lastWord}\")...", end = " ")
|
||||||
if lastWord in universalBase: # check if the last word found is a supported word
|
if lastWord in universalBase: # check if the last word found is a supported word
|
||||||
|
|
Reference in a new issue