Closed juhandergod closed 1 year 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.
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 forUS
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:
Created
typoFixer
component using thetypo-js-ts
dependency for spell checkingCreated unit tests for
typoFixer
component (typoFixer.test.ts
)Created unit test for
stripSpecialCharacter
component (stripSpecialCharacter.test.ts
)Added dependencies:
typo-js-ts
dependency - Spell checker dependencyAdded
en_US
dictionary fortypo-js-ts
dependency:en_US.aff
,en_US.dic
)Added dev-dependencies for testing with
jest
:@babel/preset-env
@babel/preset-typescript
@jest/globals
@types/jest
jest
ts-jest
Changed:
package.json
scripts section with a new script for running testsRunning the tests
sectionbuild.yml
github workflow action withrun tests
stepmongoose
upgraded to version6.4.6
@types/express
upgraded to version4.17.20
@types/node
upgaded to version14.18.63
typescript
upgraded to version4.9.5
Check List (Check all the applicable boxes)
Screenshots
Note to reviewers
Should I update the changelog, or is that generated automatically?