Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boyter/java-spelling-corrector
A MIT Licensed Java Spelling Corrector
https://github.com/boyter/java-spelling-corrector
Last synced: 6 days ago
JSON representation
A MIT Licensed Java Spelling Corrector
- Host: GitHub
- URL: https://github.com/boyter/java-spelling-corrector
- Owner: boyter
- License: mit
- Created: 2016-08-17T08:19:53.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-12-22T22:39:49.000Z (almost 4 years ago)
- Last Synced: 2024-10-31T05:51:31.424Z (13 days ago)
- Language: Java
- Size: 6.84 KB
- Stars: 7
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# java-spelling-corrector
A MIT Licensed Java Spelling CorrectorThis came about because I was unable to find a liberally licenced spelling corrector for Java that was basicly a simple class.
Makes the following assumptions,1. You will supply the word's that will be used for comparisons.
2. You are responsible for cleaning the words. If you put in init_something then by golly it will assume thats a vaild word to match on.
3. It assumes that whatever was typed at least got the first letter correct.
4. Only spans out as far as 2 changes from for words, so "wong" will match "wrongs" but "woz" will not.
5. Does not letter flip checks to see if someone typed things backwards IE "wrogn" matching "wrong" although it should work anyway due to 4.
6. Takes exact length matches over lesser, so "wrongz" will correct to "wrongs" over "wrong"It's tries to be as fast as possible and use as little memory as it can.
Usage is fairly simple.
`ISpellingCorrector sc = new SpellingCorrector(10000);`
`sc.putWord("wrong");`
`sc.correct("wrongs"); // Will return wrong`
Happy hacking.