@Test public void normalizeChar() throws Exception { Assert.assertEquals("Helloo", normalizer.normalize("Helllllloooooo")); Assert.assertEquals("Hello", normalizer.normalize("Hello")); Assert.assertEquals("HHello", normalizer.normalize("HHello")); }
public CharSequence normalize (CharSequence text) { text = SPACE_REGEX.matcher(text).replaceAll(" "); return REPEATED_CHAR_REGEX.matcher(text).replaceAll("$1$1").trim(); }
ShrinkCharSequenceNormalizer implements CharSequenceNormalizer { public CharSequence normalize (CharSequence text) { text = SPACE_REGEX.matcher(text).replaceAll(" "); return REPEATED_CHAR_REGEX.matcher(text).replaceAll("$1$1").trim(); } }
ShrinkCharSequenceNormalizer implements CharSequenceNormalizer { public CharSequence normalize (CharSequence text) { text = SPACE_REGEX.matcher(text).replaceAll(" "); return REPEATED_CHAR_REGEX.matcher(text).replaceAll("$1$1").trim(); }  }
ShrinkCharSequenceNormalizer implements CharSequenceNormalizer { public CharSequence normalize (CharSequence text) { text = SPACE_REGEX.matcher(text).replaceAll(" "); return REPEATED_CHAR_REGEX.matcher(text).replaceAll("$1$1").trim(); }  static ShrinkCharSequenceNormalizer getInstance(); CharSequence normalize(CharSequence text); }
ShrinkCharSequenceNormalizer implements CharSequenceNormalizer { public CharSequence normalize (CharSequence text) { text = SPACE_REGEX.matcher(text).replaceAll(" "); return REPEATED_CHAR_REGEX.matcher(text).replaceAll("$1$1").trim(); }  static ShrinkCharSequenceNormalizer getInstance(); CharSequence normalize(CharSequence text);  }