Tag: false Ofo does not check XML spell Boolean return nal
Word Checker
This item is used for word spell checking.
Project Introduction
Word checker is used for word spell checking.
Github Address
Feature Description Support i18n
Error prompt Support i18n
Support for English word correction
New features that will be added later
Quick start of JDK version
JDK1.7 and later
Introductory example Maven Introduction
This project has been uploaded to the Maven repository and can be directly introduced
<dependency> <groupId>com.github.houbb</groupId> <artifactId>word-checker</artifactId> <version>0.0.1</version></dependency>
Test case
public static void main(String[] args) { final String result = EnWordChecker.getInstance().correct("speling"); System.out.println(result);}
Result is
spelling
English spelling correction function introduction
Note
All methods are EnWordChecker
under class.
function |
Method |
Parameters |
return value |
Notes |
Determine if a word is spelled correctly |
Iscorrect (String) |
Words to be detected |
Boolean |
|
Return the best corrective results |
Correct (String) |
Words to be detected |
String |
If you don't find a word that can be corrected, it returns itself |
Determine if a word is spelled correctly |
Correctlist (String) |
Words to be detected |
List<string> |
Returns all matching corrections lists |
Determine if a word is spelled correctly |
Correctlist (string, int limit) |
The word to be detected returns the size of the list |
Returns the corrected list of the specified size |
List size <= limit |
Test examples
See also [] ()
/** * 是否拼写正确 */@Testpublic void isCorrectTest() { final String hello = "hello"; final String speling = "speling"; Assert.assertTrue(EnWordChecker.getInstance().isCorrect(hello)); Assert.assertFalse(EnWordChecker.getInstance().isCorrect(speling));}
/*** 返回最佳匹配结果*/@Testpublic void correctTest() { final String hello = "hello"; final String speling = "speling"; Assert.assertEquals("hello", EnWordChecker.getInstance().correct(hello)); Assert.assertEquals("spelling", EnWordChecker.getInstance().correct(speling));}
/** * 默认纠正匹配列表 * 1. 默认返回所有 */@Testpublic void correctListTest() { final String word = "goo"; List<String> stringList = EnWordChecker.getInstance().correctList(word); Assert.assertTrue(stringList.size() > 0);}
/** * 默认纠正匹配列表 * 1. 默认返回所有 */@Testpublic void correctListTest() { final String word = "goo"; List<String> stringList = EnWordChecker.getInstance().correctList(word); Assert.assertTrue(stringList.size() > 0);}
Technical Acknowledgement
The original English word data provided by Words.
Document reference
ENABLE word List
Spell-correct
Spellchecking
Java English word correction check frame (word Checker)