Package dkpro.similarity.algorithms.lexical.ngrams

Examples of dkpro.similarity.algorithms.lexical.ngrams.WordNGramContainmentMeasure


    // These are the two input documents
    String[] tokens1 = "The quick brown fox jumps over the lazy dog".split(" ");    
    String[] tokens2 = "The quick brown dog jumps over the lazy fox".split(" ");
   
    // Compute a trigram relatedness   
    TextSimilarityMeasure measure = new WordNGramContainmentMeasure(3);

    double score = measure.getSimilarity(tokens1, tokens2);

    System.out.println("Trigram similarity: " + score);
   
    // Compute ESA relatedness on Wiktionary    
    /*VectorComparator esa = new VectorComparator(
View Full Code Here

TOP

Related Classes of dkpro.similarity.algorithms.lexical.ngrams.WordNGramContainmentMeasure

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.