JTextArea Real Time Spell Checker

我只是一个虾纸丫 提交于 2019-11-30 18:11:39

问题


I need a good spell checker library for Java that can spell check a JTextArea (or any JTextComponent) in real time. That is, it should have a wavy red underline appear under text while the user is typing.

It needs to be able to list all the available word replacements by left clicking (yes, left clicking) the word. If not possible, right-click is fine.

It needs to have an "Ignore All," but not an Add, Ignore, or any of the others. Just Ignore All.

Ideally, you should be able to change how the dropdown box looks, at least to some extent.

No user-spell checker is needed. That is, I don't need a button that when you click it brings up a spell check dialog, I only need real time checking. I actually already have a spell checking dialog library.

If someone can suggest a good library (I am willing to pay for it) or, better yet, explain a good method for doing this to a textarea in the first place that would be fantastic.

At the very least if someone could explain how to check the JTextArea against my dictionary and put the red underline and the dropdown on clicking or any of these steps that would be a great start.

Thanks for the potential help.


回答1:


http://jortho.sourceforge.net/

Sample can be seen here http://www.inetsoftware.de/other-products/jortho/sample




回答2:


Trying to make a complete list. Feel free to add.

Full-blown solutions

  • JOrtho
    • Wordlist comes from Wiktionary
  • JaSpell is a Java implementation of the popular Aspell.
  • JMySpell
    • Uses the OpenOffice.org dictionaries
  • Wintertree
    • non-free

Libraries

  • HunspellJNA used as backend by LanguageTool
  • Jazzy
  • JSpell SDK can be used as basis
  • LanguageTool also includes a Grammar check
    • a small wrapper application is shown at https://github.com/pminos/languagetool-wrapper-demo-parent
  • Suggester



回答3:


Decided to go with Wintertree



来源:https://stackoverflow.com/questions/4052988/jtextarea-real-time-spell-checker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!