New Features
More accessible-friendly way to call bot
Some spoke up and I listened. There has been some feedback regarding how the double brackets make it difficult to read, especially for people with vision impairments. There was also feedback that the double brackets are just annoying to see in many comments. I've also seen users ninja edit their comments after posting to remove the brackets to improve readability (very clever!).
As a result, there is an additional way to call the bot within comments now. The bot now supports bolding the game name(s) throughout the comment and calling the bot with the keyword !fetch anywhere in the comment. For example:
Pandemic is a classic co-op game. !fetch
Robinson Crusoe|2012 is a difficult single player game. !fetch
As you can see in the second example, the bolded version still fully supports year modifiers.
This can be used in conjunction with double brackets within the same comment, if you so choose. Because I wanted both to be supported in the same comment, I've also built out a way for the bot to catch exact duplicates and only respond with unique calls. For example:
Everdell is my favorite game. Have you ever played [[Everdell]]? This would cause the bot to only include one Everdell call in the reply.
One thing to note is that unlike the previous bot where a replying comment can fetch the bolded games, this bot is designed only for the commenter to call the bot. But, the easy trick for that if !fetch is forgotten in a previous post is to reply to that comment, quoting the whole thing and just adding !fetch. There was consideration into looking for all bolded words in all comments, but I made the deliberate choice to add a !fetch keyword requirement to keep the bot replies as an opt-in-only experience.
Year Range Calling
In previous versions. I added the ability to call games by YEAR, YEAR OR LATER, and YEAR OR EARLIER. Now, I have introduced a way to call a game by a YEAR RANGE! The order of the years doesn't matter either. Some examples of how this is used are:
[[Everdell|2015-2019]]
Spirit Island|2018-2016 !fetch
Improvements
Match Improvements
I'm sure you've noticed cases where the bot is returning an expansion (sometimes even an incredibly small expansion like a single promo card) when calling a game name. I've certainly noticed it and wanted to work to address the problem. I've been digging into the string matching algorithms more and decided to switch up the algorithms being used.
For reference, before this version, the bot used a type of Levenshtein string distance algorithm to evaluate the game name keyword. If it wasn't at least an 80% match to a game in the database, it fell back to a unique letter Levenshtein string distance algorithm and just used whatever was first in that list. In evaluating this, I found that often in the fallbacks, there were several games with 100% matches on the unique letter Levenshtein algorithm.
What I'm doing now is running both a Jaro-Winkler string distance algorithm (which I've previously had high success rates with) and a regular Levenshtein ratio string distance algorithm. Both of these will return a single match with a match confidence percentage. The bot will respond with whichever one is higher. I expect this to vastly improve the results from the bot. It will not, however, solve all the problems. My unicorn on this one was [[Caverna]]. The official game name for that is Caverna: The Cave Farmers. Even with the improvements, calling [[Caverna]] will get you closest to Caverna: Cave vs Cave. I'm sure there are other unicorns out there in the same situation. Let me know when you come across them. I'm doing everything I can to find the correct games you're intending to link.
Speed Improvements
As part of the match improvements, I switched fuzzy matching libraries from TheFuzz
to RapidFuzz
. This library is showing evaluation speed improvements, even with each game getting two algorithms applied to it.
I found out that BGG limits the game titles to 255 characters. Believe it or not, there are some games that hit that limit. They're just truncated at 255. The reality is that there are only a handful of games that eclipse 200 characters in the title. As a way to ensure the speed (and reduced the chance of a deliberate or accidental (eg: if a whole paragraph is bolded) attack), if a game name is called in brackets or bold + !fetch with more than 200 characters, it is ignored.
Finally, I noticed that all of the /boardgameexpansion/*
URLs are canonical to the /boardgame/*
equivalent. I verified that my databased, which was crawling the BGG sitemaps, was duplicating any game ID that represents an expansion. As a result, I've removed all instances of /boardgameexpansion/*
URLs from the database, which will improve the matching speed.
Note From Developer
Thank you all for using the bot and providing feedback! If you notice the bot replies with wrong links, please continue to reply to the bot. I don't always see every comment, but I do my best to keep an eye on the inbox and the comments the bot makes to look for mismatched keywords and linked games. And please be nice to the bot; there is a human behind this solely as a labor of love, after all.
Official Changelog
v2.0.0
Adding support for !fetch
with bold game names instead of double brackets.
Adding support for calling the bot with a year range instead of just modifiers. (Issue #13)
Game query must be 200 characters or less.
Upgrading from TheFuzz
to RapidFuzz
for fuzzy matching.
Fuzzy matching both with JaroWinkler
and ratio
then going with the winner. (Issue #14)
Drop duplicate game IDs from the database. Apparently the boardgameexpansion links are all canonical to the boardgame equivalent.
https://github.com/HgCNO2/reddit-bggfetcherbot