public boolean matches(String word, Dictionary dic) {
		if (p == null || !p.matches(word)) {
			return false;
		}
		String adyWord = word.charAt(adyecentIndexes.get(i)) + adyecentRestrictions.get(i);
		for (int i=0; i<adyecentRestrictions.size(); i++) {
			if (!dic.contain(adyWord) && 
				!dic.contain(new StringBuilder(adyWord).reverse().toString())) {
				return false;
			}
		}
		return true;
	}