All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bigdata.search.TermMetadata Maven / Gradle / Ivy

package com.bigdata.search;

/**
 * Mutable metadata for the occurrences of a term within a field of some
 * document.
 * 
 * @author Bryan Thompson
 * @version $Id$
 */
public class TermMetadata implements ITermMetadata {

//    /**
//     * The token.
//     */
//    private final String token;
    
    /**
     * The local term weight, which may be computed by a variety of methods.
     */
    private double localTermWeight;
    private int noccurrences;

//    public TermMetadata(final String token) {
//        
//        this.token = token;
//    }
//    
//    public String termText() {
//        
//        return token;
//        
//    }
    
    public int termFreq() {
    
        return noccurrences;
        
    }
    
    final public double getLocalTermWeight() {

        return localTermWeight;
        
    }

    final public void setLocalTermWeight(final double d) {
        
        localTermWeight = d;
        
    }
    
    public void add() {

        noccurrences++;
        
    }

    public String toString() {

        return "{noccur=" + noccurrences + ",weight=" + localTermWeight + "}";

    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy