@Test public void normalizeSpace() throws Exception { Assert.assertEquals( "a text extra space", normalizer.normalize("a text extra space")); }
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);  }