/spelling-corrector/src/spell/Main.java
Java | 33 lines | 13 code | 9 blank | 11 comment | 0 complexity | 6db5b5d1c0863c2e625a2dfcc24fc024 MD5 | raw file
- package spell;
- import java.io.IOException;
- import spell.ISpellCorrector.NoSimilarWordFoundException;
- /**
- * A simple main class for running the spelling corrector. This class is not
- * used by the passoff program.
- */
- public class Main {
- /**
- * Give the dictionary file name as the first argument and the word to correct
- * as the second argument.
- */
- public static void main(String[] args) throws NoSimilarWordFoundException, IOException {
- String dictionaryFileName = args[0];
- String inputWord = args[1];
- /**
- * Create an instance of your corrector here
- */
- ISpellCorrector corrector = new Spell();
- corrector.useDictionary(dictionaryFileName);
- String suggestion = corrector.suggestSimilarWord(inputWord);
- System.out.println("Suggestion is: " + suggestion);
- }
- }