A Simple SpellCHecker Program in Java that allows to insert, search, getclosest words in a dictionary.
- This is a Java program to implement a spell checker.
- It is implemented in two ways
- Using Set Data Structure
- Using Trie Data Structure
- The program takes a string input and checks each word in the string against the dictionary.
- If the word is found in the dictionary, it is printed in blue, otherwise it is printed in red.
- The possible corrections for the misspelled words are also displayed.
- The program also has a method to convert a text file into a dictionary (Set or Trie) and a method to get the closest word in the dictionary for a given word.
You need to have the following software installed on your system:
- Java (1.8 or later)
- A text file containing dictionary words ( if you use another file of your choice )
Clone : git clone https://github.com/OpenGenus/spell-checker-java.git
or download the repository (zip file) to your local machine.
- For Set Data Structure
Compile the java code using the following command:
javac Main.java SpellChecker.java
- For Trie Data Structure
Compile the java code using the following command:
javac Main.java Spellchecker.java Trie.java
Run the codes using the following command:
java Main