Skip to content

Enhance off-topic names search feature#436

Merged
kosayoda merged 1 commit into
masterfrom
enhance-offtopicnames-search
Sep 18, 2019
Merged

Enhance off-topic names search feature#436
kosayoda merged 1 commit into
masterfrom
enhance-offtopicnames-search

Conversation

@SebastiaanZ
Copy link
Copy Markdown
Contributor

There's a more colorful description, with examples, in the issue: #435. The examples there were generated using this code.

Taken from commit cfb6b63:
This commit is meant to enhance the search feature in three separate, but related ways:

  1. By changing the type annotation of the query to OffTopicName, we will use the same character translation table for the query as we did when storing the off-topic name, leading to better matches.

  2. By adding a membership test, query in name, we are better able to search for off-topic names using a substring.

  3. Given point 1 and point 2, we can increase the cut-off value we use for difflib.get_close_matches so we reduce the number of matches that bear little resemblance to the query in our human eyes.

This PR closes #435

#435

This commit is meant to enhance the search feature in three separate,
but related ways:

1. By changing the type annotation of the query to OffTopicName, we
   will use the same character translation table for the query as we
   did when storing the off-topic name, leading to better matches.

2. By adding a membership test, `query in name`, we are better able to
   search for off-topic names using a substring.

3. Given point 1 and point 2, we can increase the cut-off value we use
   for `difflib.get_close_matches` so we reduce the number of matches
   that bear little resemblance to the query in our human eyes.

This commit closes #435
@kosayoda kosayoda merged commit 83127be into master Sep 18, 2019
@MarkKoz MarkKoz deleted the enhance-offtopicnames-search branch September 18, 2019 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance off-topic name search feature

3 participants