public HashSet<String> search(String text){

		if(text.length()==0){
			return null;
		}
		HashSet<String> termsThatHit = new HashSet<String>();
		int i = patternLength;
		for (int count = i; count > 0; count--) {
			int k, j, N = text.length();
			int P = pattern[i - count].length();
			for (k = 0, j = 0; k < N && j < P; k++)
				j = dfa[i - count][text.charAt(k)][j];
			if (j == P) {
				k = k - P + 1;
				termsThatHit.add(pattern[i - count]);
			} 
		}
		return termsThatHit;
	}