Tabnine Logo
StringSimilarityService.scoreAll
Code IndexAdd Tabnine to your IDE (free)

How to use
scoreAll
method
in
net.ricecode.similarity.StringSimilarityService

Best Java code snippets using net.ricecode.similarity.StringSimilarityService.scoreAll (Showing top 2 results out of 315)

origin: ch.sahits/sahitsUtil

for (ComparableFilenameWord misspelledWord : words) {
  StringBuilder sb = new StringBuilder();
  List<SimilarityScore> scores = service.scoreAll(dict.getWords(), misspelledWord.toString());
  Collections.sort(scores, comp);
  sb.append(misspelledWord).append(": ");
origin: rrice/java-string-similarity

@Test
public void testScoreAll() {
  SimilarityStrategy strategy = mock(SimilarityStrategy.class);
  String target = "McDonalds";
  String c1 = "MacMahons";
  String c2 = "McPherson";
  String c3 = "McDonalds";
  
  when(strategy.score(target, c1)).thenReturn(0.90);
  when(strategy.score(target, c2)).thenReturn(0.74);
  when(strategy.score(target, c3)).thenReturn(1.000);
  
  StringSimilarityService service = new StringSimilarityServiceImpl(strategy);
  List<String> features = new ArrayList<String>();
  features.add(c1);
  features.add(c2);
  features.add(c3);
  
  List<SimilarityScore> scores = service.scoreAll(features, target);
  verify(strategy).score(c1, target);
  verify(strategy).score(c2, target);
  verify(strategy).score(c3, target);
  assertEquals(3, scores.size());
}
net.ricecode.similarityStringSimilarityServicescoreAll

Javadoc

Calculates all similarity scores for a given set of features.

Popular methods of StringSimilarityService

  • score
    Calculates the similarity score of a single feature.
  • findTop
    Finds the feature within a set of given features that best match the target string.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • startActivity (Activity)
  • onRequestPermissionsResult (Fragment)
  • getSharedPreferences (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Notification (javax.management)
  • Runner (org.openjdk.jmh.runner)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now