public int[][] DFA(String pattern) {
		int patternLength = pattern.length();
		int[][] dfa = new int[alphabet][patternLength];
		dfa[pattern.charAt(0)][0] = 1;
		for (int X = 0, j = 1; j < patternLength; j++) { 
           for (int character = 0; character < alphabet; character++) 
              dfa[character][j] = dfa[character][X];
           dfa[pattern.charAt(j)][j] = j+1;
           X = dfa[pattern.charAt(j)][X];
        }
		return dfa;
	}