ReadMeExample { public static float example02() { String str1 = "This is a sentence. It is made of words"; String str2 = "This sentence is similar. It has almost the same words"; StringMetric metric = StringMetricBuilder .with(new CosineSimilarity<String>()) .simplify(Simplifiers.toLowerCase(Locale.ENGLISH)) .simplify(Simplifiers.replaceNonWord()) .tokenize(Tokenizers.whitespace()).build(); float result = metric.compare(str1, str2); return result; }  static float example01(); static float example02(); static float example03(); static float example04();  }
@Test public void example02(){ assertEquals(0.5720f, ReadMeExample.example02(), DELTA); }