AlgoBox { public static String nGramKey(String sInput) { if (sInput == null) { return null; } return NGRAMKEYER.key(sInput); }  static void main(String[] args); static String pick_Char(String sInput, String pattern); static String first_N_Consonants(String sInput, int nb); static String first_N_Vowels(String sInput, int nb); static String subStr(String sInput, String pattern); static String first_N_Char(String sInput, int nb); static String last_N_Char(String sInput, int nb); static String first_N_Char_EW(String sInput, int nb); static String first_Char_EW(String sInput); static String soundex(String sInput); static String doublemetaphone(String sInput); static String metaphone(String sInput); static String add_Left_Char(String sInput, String position); static String add_Right_Char(String sInput, String position); static String removeDiacriticalMarks(String sInput); static String exact(String sInput); static String useDefault(String sInput, String insteadOf); static String lowerCase(String sInput); static String upperCase(String sInput); static String removeDMAndLowerCase(String sInput); static String removeDMAndUpperCase(String sInput); static String fingerPrintKey(String sInput); static String nGramKey(String sInput); static String colognePhonetic(String sInput);  }
@Test public void testNGramKey() { assertEquals(null, AlgoBox.nGramKey(null)); assertEquals("esstte", AlgoBox.nGramKey(TEST_STR)); assertEquals("essttett", AlgoBox.nGramKey("Test\ntest")); assertEquals("essttett", AlgoBox.nGramKey("Test\ttest")); assertEquals("122aabbcesstt1tett", AlgoBox.nGramKey("Test test12abc")); assertEquals(BLANK_STR, AlgoBox.nGramKey(BLANK_STR)); assertEquals(BLANK_STR, AlgoBox.nGramKey(SPACE_STR)); assertEquals("llnuul", AlgoBox.nGramKey(NULL_STR)); assertEquals(BLANK_STR, AlgoBox.nGramKey(QUO_STR)); assertEquals("リンンゴ", AlgoBox.nGramKey(JAPANESE1_STR)); assertEquals("べるを食ゴをリンンゴ食べ𠀀𠀁𠀁𠀂𠀂𠀃𠀃リ", AlgoBox.nGramKey("𠀀𠀁𠀂𠀃 リンゴ を 食べる")); }