How to Check Words Spelling in Java using Jazzy API

Check Words Spelling in Java using Jazzy API

In this tutorial, I am writing Simple Java Program about, How to Check Words Spelling in Java. The example program was done using Jazzy API, Which is used to Check Words Spelling in Java. The Program has been tested with environment and output is shared in the same post.

Generally, The Jazzy API is used to perform Spelling Correction for Given String in Java. It can be downloaded in the below link.

Download Jazzy Core 0.5.2 Jar and Add downloaded jar file to your eclipse Project.

Once its done, Create a folder with a my_dictionary.txt text file (Note: You can even Change File Name based on your convenience). The text file should contains a list of Proper English words. You can download the sample word file in the following link.

http://introcs.cs.princeton.edu/java/data/words.utf-8.txt

Project Structure

Make sure that, You have added and organized all required files such as Jazzy API and my_dictionary.txt properly in your eclipse project. even I have attached the sample Screen Shot of Project Structure, Which you can find below.

Check Words Spelling in Java

MySpellCheckListener.java

MyDictionaryMap.java

MySpellChecker.java

Check Words Spelling in Java

The SpellCheckerApplication is a class, which contain the main method. Eventually Its our entry point of Java Spelling Checker application.

SpellCheckerApplication.java

Output

—————
Enter the Sentence with Spelling Mistake..
hello everyoen, I am java softwaree professinoal.
Before Correction : hello everyoen, I am java softwaree professinoal.
After Correction : hello everyone, I am java software professional.