CustomizeTrie implements ITrie { public void search(String input, String match,String rawInput){ String local = ""; int index = 0; String prefix = input.replaceAll("[/-]+", ""); if(prefix.isEmpty() || prefix.length() == 1){ return; } SortedMap<String, List<String>> dataset = searchPrefix(dictionary, prefix); for(Map.Entry<String,List<String>> entry :dataset.entrySet()) { for(int i = 0; i < entry.getValue().size(); i++){ String cleanedValue = entry.getValue().get(i).replaceAll("\"", ""); String key = entry.getKey(); boolean condition = key.equals(prefix) || prefix.startsWith(key); if(match.replace(" ", "").length() == rawInput.length()){ print(rawInput, lost+" " + match); }else if((prefix.length() - cleanedValue.length()) == 1&& condition){ print(rawInput, lost+" " + match + entry.getValue().get(i) + " " +prefix.substring(prefix.length()-1, prefix.length())); }else if(cleanedValue.length() < prefix.length() && condition){ index = cleanedValue.length(); local = entry.getValue().get(i); String lo = prefix.substring(cleanedValue.length(), prefix.length()); search(lo,match + entry.getValue().get(i) + " ",rawInput); }else if (prefix.length() == cleanedValue.length()&& condition){ print(rawInput, lost+ " " + match + cleanedValue); state = true; } } } if(!state){ preprocessSearch(input, match, rawInput, local, index, prefix); } lost = ""; } CustomizeTrie(); SortedMap<String, List<String>> getDataStructure(); boolean buildTrie(String fileName); void encodeNumber(String fileName); void search(String input, String match,String rawInput);  }
@Test public void testSearch() { fail("Can Not Implement as Console will be printed for this"); }