We've recently added a search feature for off-topic names. It's a really cool feature, but I think it can be enhanced in a couple of ways. (Use the informal definition of "couple": "an indefinite small number.")
For all the examples, this is the list of off-topic-names in the database:

1. Use OffTopicName converter for the query argument
We don't use the characters as-is in off-topic names, but we use a translation table on the string input. However, we don't do that yet for the search query of the search feature. This leads to interesting search results:

If we change the annotation to query: OffTopicName, we utilize the same conversion for the query as we use for the actual off-topic-names, leading to much better results:

2. Add a simple membership test of query in offtopicname
Currently, we utilize difflib.get_close_match to get results that closely match the query. However, this function will match based on the whole off-topic name, so it doesn't do well if we search for a substring of the off-topic name. (I suspect this is part of the reason we use relatively low cutoff.)
While there's clearly a "pool" in volcyy's underground, we don't find it:

If we add a simple membership test to the existing get_close_match, we do get the results we expect:

3. Given the membership test of suggestion 2, up the cutoff
The low cutoff does allow us some leeway when searching for partial off-topic names, but it also causes interesting results. Using the current search feature, without the membership testing suggested in 2, we don't find "eevee-is-cooler-than-python" when we search for "eevee", but "eivl's-evil-eval":

However, if we up the cutoff value and combine it with an additional membership test, we can search for "sounds-like" off-topic names and find off-topic names that contain exact matches:


We've recently added a search feature for off-topic names. It's a really cool feature, but I think it can be enhanced in a couple of ways. (Use the informal definition of "couple": "an indefinite small number.")
For all the examples, this is the list of off-topic-names in the database:
1. Use
OffTopicNameconverter for thequeryargumentWe don't use the characters as-is in off-topic names, but we use a translation table on the string input. However, we don't do that yet for the search query of the search feature. This leads to interesting search results:
If we change the annotation to
query: OffTopicName, we utilize the same conversion for the query as we use for the actual off-topic-names, leading to much better results:2. Add a simple membership test of
query in offtopicnameCurrently, we utilize
difflib.get_close_matchto get results that closely match the query. However, this function will match based on the whole off-topic name, so it doesn't do well if we search for a substring of the off-topic name. (I suspect this is part of the reason we use relatively low cutoff.)While there's clearly a "pool" in volcyy's underground, we don't find it:
If we add a simple membership test to the existing
get_close_match, we do get the results we expect:3. Given the membership test of suggestion 2, up the cutoff

The low cutoff does allow us some leeway when searching for partial off-topic names, but it also causes interesting results. Using the current search feature, without the membership testing suggested in 2, we don't find "eevee-is-cooler-than-python" when we search for "eevee", but "eivl's-evil-eval":
However, if we up the cutoff value and combine it with an additional membership test, we can search for "sounds-like" off-topic names and find off-topic names that contain exact matches: