Package owlsmx.utils

Examples of owlsmx.utils.CosineResultTriple


     */
    public double computeSimilarity(String query, String token1, String service, String token2) throws MatchingException {
        Map pc1 = tokenizer.getTokenFrequencies(token1);
        Map pc2 = tokenizer.getTokenFrequencies(token2);

        CosineResultTriple TFs = getTFArrays(pc1, pc2);
        double[] weightedPC1 =  weigthAndNormalizeTerms(TFs.term1);           
        double[] weightedPC2 =  weigthAndNormalizeTerms(TFs.term2);
        double temp = computeSimilarity(weightedPC1,weightedPC2);
        double result = -0.5 * temp / log2;
        return result;
View Full Code Here


    public double computeSimilarity(String query, String token1, String service, String token2) throws MatchingException {

        Map pc1 = tokenizer.getTokenFrequencies(token1);
        Map pc2 = tokenizer.getTokenFrequencies(token2);
       
        CosineResultTriple TFs = getTFArrays(pc1, pc2);
        if ( (pc1.size()==0) && (pc2.size()==0) )
            return 1.0;

        double[] weightedPC1 =  weigthAndNormalizeTerms(TFs.term1,TFs.idf);           
        double[] weightedPC2 =  weigthAndNormalizeTerms(TFs.term2,TFs.idf);
View Full Code Here

            //    idf[count] = 1;
            //System.out.println("           r1: " + r1[count] + "  r2: " + r2[count] + " idf " + idf[count]);
            count++;
        }
       
      return new CosineResultTriple(r1,r2,idf);
    }
View Full Code Here

     */
    public double computeSimilarity(String query, String token1, String service, String token2) throws MatchingException {
        Map pc1 = tokenizer.getTokenFrequencies(token1);
        Map pc2 = tokenizer.getTokenFrequencies(token2);       
       
        CosineResultTriple TFs = getTFArrays(pc1, pc2);
        double[] weightedPC1 =  weigthAndNormalizeTerms(TFs.term1);           
        double[] weightedPC2 =  weigthAndNormalizeTerms(TFs.term2,TFs.idf);
       
        if ( (weightedPC1.length==0) && (weightedPC2.length==0) ) {
            return 1.0;
View Full Code Here

TOP

Related Classes of owlsmx.utils.CosineResultTriple

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.