0

I find that c api are available for the aspell but i would like to use it in java code. I know there is JNI framework by which we can call the c library but i am not able to use it in aspell case,

Can anyone suggest some methods by which i can use the aspell spelling checker in the java program ? I need to work on opensource spell checker.

I tried with the google spell checker api but they are not currently available. I think google has stopped spell checker free service.

Naveen
  • 139
  • 2
  • 11
  • Did you try something with JNA (http://en.wikipedia.org/wiki/Java_Native_Access)? If, what are the problems exactly? – deviantfan Jan 02 '14 at 21:08
  • Other spell checkers are discussed at http://stackoverflow.com/questions/4052988/jtextarea-real-time-spell-checker – koppor Jul 09 '15 at 07:27

2 Answers2

1

Providing links for available spell checkers for Java

Jazzy - http://sourceforge.net/projects/jazzy/

JaSpell - http://sourceforge.net/projects/jaspell/

JOrtho - http://sourceforge.net/projects/jortho/

Try them. post your experience.

Amit G
  • 2,293
  • 3
  • 24
  • 44
1

JavaSpell provides a wrapper to the aspell command for Java and is pretty simple to use.

import java.io.IOException;
import java.util.List;

import nl.indenty.javaspell.ASpellException;
import nl.indenty.javaspell.ASpellWrapper;
import nl.indenty.javaspell.SpellCheckResult;

public class Dictionary {


    public static void main(String[] args) throws IOException, ASpellException {
        ASpellWrapper aSpell = new ASpellWrapper("en");
        List<SpellCheckResult> results = aSpell.checkString("Spellchecker for English wodrs made easz");

        for(SpellCheckResult result : results){
            System.out.println(result.getWord() +" --> " +result.getSuggestions());
        }
    }
}

And this is how the output would look like:

wodrs --> [words, Woods, woods, word's, wards, ...]
easz --> [ease, easy, East, east]

Install by:

svn checkout http://javaspell.googlecode.com/svn/trunk/ javaspell-read-only
cd javaspell-read-only
mvn install -DskipTests

Jazzy looks pretty useful and this thread describes how to generate dictionaries for different languages: https://superuser.com/questions/137957/how-to-convert-aspell-dictionary-to-simple-list-of-words

Community
  • 1
  • 1
user3776894
  • 183
  • 1
  • 8