StringMetricBuilderExample { public static float example07() { String a = "A quirky thing it is. This is a sentence."; String b = "This sentence is similar; a quirky thing it is."; Cache<String,String> stringCache = CacheBuilder.newBuilder() .maximumSize(2) .build(); Cache<String,Multiset<String>> tokenCache = CacheBuilder.newBuilder() .maximumSize(2) .build(); StringMetric metric = with(new CosineSimilarity<String>()) .simplify(Simplifiers.toLowerCase()) .simplify(Simplifiers.removeNonWord()) .cacheStrings(stringCache) .tokenize(Tokenizers.qGram(3)) .cacheTokens(tokenCache) .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 example07(){ assertEquals(0.6902f, StringMetricBuilderExample.example07(), DELTA); }