Skip to main content

Posts

Showing posts with the label spell checker

Spell Checker using TRIE

Spell checker program using TRIE data structure. Dictionary source is from Dictionary.txt, which is to be in the same directory of the program, or else change the file name and location //Possible.java import java.io.*; import java.util.*; class TrieNode {     char letter;     TrieNode[] links;     boolean fullWord;     TrieNode(char letter, boolean fullWord) {         this.letter = letter;         links = new TrieNode[26];         this.fullWord = fullWord;     } } public class Possible {     static TrieNode createTree()     {         return(new TrieNode('', false));     }     static void insertWord(TrieNode root, String word)     {         int offset = 9...

Spell Checker

This is a program which takes a word as input and gives possible suggestions to correct the spelling of the word, by searching them from the dictionary of words(a text file Dictionary.txt). // Spell.java import java.io.*; import java.util.*; public class Spell {     static ArrayList<String> wordsList = new ArrayList<String>();     public static void main(String args[]) throws IOException     {         try {             long build1 = System.currentTimeMillis();             FileInputStream fstream = new FileInputStream("Dictionary.txt");             BufferedReader br = new BufferedReader(new InputStreamReader(fstream));             String ele;             ...