Looking for Java spell checker library [closed]

2019-01-04 08:19发布

I am looking for an open source Java spell checking library which has dictionaries for at least the following languages: French, German, Spanish, and Czech. Any suggestion?

8条回答
Summer. ? 凉城
2楼-- · 2019-01-04 08:46

Hunspell looks like it could be of use. It is written in C++ but a java interface according to the home page. Tri-licensed under GPL, LGPL and MPL so you shouldn't have a problem with it.

查看更多
Ridiculous、
3楼-- · 2019-01-04 08:51

Another good library is JLanguageTool http://www.languagetool.org/usage/ It has a pretty simple api and does both spelling and grammar checking/suggestions.

JLanguageTool langTool = new JLanguageTool(Language.AMERICAN_ENGLISH);
langTool.activateDefaultPatternRules();

List<RuleMatch> matches = langTool.check("Hitchhiker's Guide tot he Galaxy");
for (RuleMatch match : matches) {
    System.out.println("Potential error at line " +
        match.getEndLine() + ", column " +
        match.getColumn() + ": " + match.getMessage());
    System.out.println("Suggested correction: " +
        match.getSuggestedReplacements());
}

You can also use it to host your own spelling and grammar web service.

查看更多
Summer. ? 凉城
4楼-- · 2019-01-04 08:56

Have a look at JaSpell. It comes with an internal spell checking engine or you can use aspell. Since the source is available, you can also attach aspell-like engines easily (like Hunspell).

It comes with filters for TeX and XML and it has support for suggestion engines like keyboard distance, common misspellings (where you can define words and their replacements for common typos), Levenshtein distance, and phonetic distance.

查看更多
老娘就宠你
5楼-- · 2019-01-04 08:57

Another possible alternative is JOrtho http://jortho.sourceforge.net

I haven't used it yet, but I'm evaluating the current Java Open Source spellcheckers to figure out which one to use.

查看更多
劳资没心,怎么记你
6楼-- · 2019-01-04 08:58

You can try Suggester. It is open source, free, and supports all of the above listed languages.

查看更多
爷的心禁止访问
7楼-- · 2019-01-04 08:59

Check out JSpell by Page Scholar, http://www.jspell.com.

查看更多
登录 后发表回答