This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
Typo checker and fixer added - Closes #771 #788
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?