EddieHubCommunity / EddieBot

Inclusive words Discord bot (no more "hey guys")
http://discord.eddiehub.org
MIT License
173 stars 138 forks source link

Typo checker and fixer added - Closes #771 #788

Closed juhandergod closed 11 months ago

juhandergod commented 11 months ago

Fixes Issue

Closes #771

Changes proposed

Hey, This PR fixes the issue for checking words with typos (#771). In the issue there were different discussions about using some type of NLTK spell checker library. For that use case I added typo-js-ts lib with defined dictionary for US language. In addition I added some additional logic to remove the non alphabetic characters from each word, and if those characters are removed, then it can check for the typos, and use the first suggestion for that word.

++ I added a testing dependency to the project (called jest) to test my new functionaly and cover some older components. Updated the Readme, and the build.yml workflow.

Added:

Changed:

Check List (Check all the applicable boxes)

Screenshots

image

Note to reviewers

Should I update the changelog, or is that generated automatically?

juhandergod commented 11 months ago

Hey @eddiejaoude , thanks for your response.

I added one test case to check if it will fix the word picking or not. It will remain the same.

But you are right. This addition can produce false positives. That's the reason why I added these libraries for typo-js-ts locally. This can be changed anytime, and fix any false positive issues. I tried it locally to produce some false positives, but I couldn't.