I have to be careful with these, because if I add a move to the database that includes "the" or "shopkeeper", it will never be read. For instance, if a database move record is set to "look at the shopkeeper" and a player tweets, "inspect the shopkeeper," one would expect that to match - except the bot's sanitizing code will update the player's tweet to "look at merchant" and will never match that database record.
In fact, if a database record includes "the," it will always be ignored, because "the" is always removed from tweets before lookup rn.
The way tweets are getting sanitized is pretty messy and happening in multiple places right now.
There's this
filter_tweet()
: https://github.com/mknepprath/lilt/blob/4b9efb6255688a468c46ffcc9e5dd7b283c3c009/bot.py#L145 This is lowercasing all text, removing punctuation, etc... https://github.com/mknepprath/lilt/blob/4b9efb6255688a468c46ffcc9e5dd7b283c3c009/utils.py#L48Then there are these lines that are replacing synonyms with the common lookup word used in the database: https://github.com/mknepprath/lilt/blob/4b9efb6255688a468c46ffcc9e5dd7b283c3c009/bot.py#L149
And this is doing something similar... https://github.com/mknepprath/lilt/blob/4b9efb6255688a468c46ffcc9e5dd7b283c3c009/bot.py#L163
I have to be careful with these, because if I add a move to the database that includes "the" or "shopkeeper", it will never be read. For instance, if a database move record is set to "look at the shopkeeper" and a player tweets, "inspect the shopkeeper," one would expect that to match - except the bot's sanitizing code will update the player's tweet to "look at merchant" and will never match that database record. In fact, if a database record includes "the," it will always be ignored, because "the" is always removed from tweets before lookup rn.
Acceptance Criteria
filter_tweet()
is being used in several locations, so make sure any changes to it don't break things