StringMetricBuilderExample { public static float example05() { Set<String> commonWords = Sets.newHashSet("it", "is"); Set<String> otherCommonWords = Sets.newHashSet("a"); String a = "A quirky thing it is. This is a sentence."; String b = "This sentence is similar; a quirky thing it is."; StringMetric metric = with(new CosineSimilarity<String>()) .simplify(Simplifiers.toLowerCase()) .simplify(Simplifiers.removeNonWord()) .tokenize(Tokenizers.whitespace()) .filter(Predicates.not(in(commonWords))) .filter(Predicates.not(in(otherCommonWords))) .tokenize(Tokenizers.qGram(3)) .build(); return metric.compare(a, b); }  static float example00(); static float example01(); static float example02(); static float example03(); static float example04(); static float example05(); static float example06(); static float example07();  }
@Test public void example05(){ assertEquals(0.6902f, StringMetricBuilderExample.example05(), DELTA); }