寻找Java拼写检查器库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/559510/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Looking for Java spell checker library
提问by avernet
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?
我正在寻找一个开源 Java 拼写检查库,该库至少包含以下语言的词典:法语、德语、西班牙语和捷克语。有什么建议吗?
采纳答案by Infamy
You should check out Jazzyits used in some high profile Java applications. Two problems with it:
您应该查看Jazzy它在一些高调的 Java 应用程序中的使用。它有两个问题:
- It has not been updated since 2005.
- There is only English dictionary on their SourceForge page.
- 它自 2005 年以来一直没有更新。
- 他们的 SourceForge 页面上只有英文词典。
There are some third party dictionaries floating around. I had one for French, last time I used jazzy.
有一些第三方词典四处流传。我有一个法语,上次我用爵士乐。
回答by Evan
回答by Aaron Digulla
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).
看看JaSpell。它带有一个内部拼写检查引擎,或者您可以使用aspell。由于源可用,您还可以轻松附加类似 aspell 的引擎(如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.
它带有用于 TeX 和 XML 的过滤器,并支持建议引擎,如键盘距离、常见拼写错误(您可以在其中定义单词及其替换常见错别字)、Levenshtein 距离和语音距离。
回答by Big Red Dog
Check out JSpell by Page Scholar, http://www.jspell.com.
查看 Page Scholar 的 JSpell,http://www.jspell.com。
回答by Mike
Another possible alternative is JOrtho http://jortho.sourceforge.net
另一种可能的选择是 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.
我还没有使用它,但我正在评估当前的 Java 开源拼写检查器,以确定使用哪个。
回答by xdevel2000
Look at this: http://code.google.com/p/google-api-spelling-java/
看看这个:http: //code.google.com/p/google-api-spelling-java/
This is a simple Java API that makes it very easy to call Google's spell checker service from Java applications.
这是一个简单的 Java API,它使得从 Java 应用程序调用 Google 的拼写检查服务变得非常容易。
I tried it and it works very well.
我试过了,效果很好。
回答by pfranza
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 http://www.languagetool.org/usage/它有一个非常简单的 api,可以进行拼写和语法检查/建议。
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.
您还可以使用它来托管您自己的拼写和语法 Web 服务。