src/traffickarmasent/tests/spellchecker-master/spellcheck.java
//This method checks the word for all possible corrections according to the problem definition.
This method checks the word for all possible corrections according to the problem definition.
This method checks the word for all possible corrections according to the problem definition .
public static void checkWord(String inputWord, int index) {
        inputWord = inputWord.toLowerCase();
        if (dict.search(inputWord)) {
            printOnce(inputWord);
            return;
        }
        else
            ;
        if (index < inputWord.length() && inputWord.charAt(index - 1) == inputWord.charAt(index)) {
            int count = 0;
            for (int i = index; i < inputWord.length(); i++) {
                if (inputWord.charAt(i) != inputWord.charAt(i - 1))
                    break;
                else
                    count++;
            }
            checkWord(inputWord.substring(0, index) + inputWord.substring(index + count), index);
            if(printOne)
                return;
            if (index - 1 + count < inputWord.length()) {
                checkWord(inputWord.substring(0, index - 1) + inputWord.substring(index), index);
                if(printOne)
                    return;
            }
            if (index + count < inputWord.length()) {
                checkWord(inputWord, index + count);
                if(printOne)
                    return;
            }
        }
        else if (index < inputWord.length()) {
            checkWord(inputWord, index + 1);
            if(printOne)
                return;
        }
        vowelSearch(inputWord, 0);
        return;
    }
public static void checkWord ( String inputWord , int index ) { inputWord = inputWord . toLowerCase ( ) ; if ( dict . search ( inputWord ) ) { printOnce ( inputWord ) ; return ; } else ; if ( index < inputWord . length ( ) && inputWord . charAt ( index - 1 ) == inputWord . charAt ( index ) ) { int count = 0 ; for ( int i = index ; i < inputWord . length ( ) ; i ++ ) { if ( inputWord . charAt ( i ) != inputWord . charAt ( i - 1 ) ) break ; else count ++ ; } checkWord ( inputWord . substring ( 0 , index ) + inputWord . substring ( index + count ) , index ) ; if ( printOne ) return ; if ( index - 1 + count < inputWord . length ( ) ) { checkWord ( inputWord . substring ( 0 , index - 1 ) + inputWord . substring ( index ) , index ) ; if ( printOne ) return ; } if ( index + count < inputWord . length ( ) ) { checkWord ( inputWord , index + count ) ; if ( printOne ) return ; } } else if ( index < inputWord . length ( ) ) { checkWord ( inputWord , index + 1 ) ; if ( printOne ) return ; } vowelSearch ( inputWord , 0 ) ; return ; }
This method checks the word for all possible corrections according to the problem definition.
This method checks the word for all possible corrections according to the problem definition .
//vowelSearch(inputWord, 0);