org.terrier.querying
Class ExpansionTerms.ExpansionTerm

java.lang.Object
  extended by org.terrier.querying.ExpansionTerms.ExpansionTerm
Enclosing class:
ExpansionTerms

public static class ExpansionTerms.ExpansionTerm
extends java.lang.Object

This class implements a data structure for a term in the top-retrieved documents.


Field Summary
protected  int documentFrequency
          The document frequency of the term in the X top ranked documents.
protected  int termID
          The term ID.
protected  double weightExpansion
          The weight for query expansion.
protected  double withinDocumentFrequency
          The number of occurrences of the given term in the X top ranked documents.
 
Constructor Summary
ExpansionTerms.ExpansionTerm(int _termID, double _withinDocumentFrequency)
          The constructor of ExpansionTerm.
 
Method Summary
 int getDocumentFrequency()
          The method returns the document frequency of term in the top-retrieved documents.
 int getTermID()
          Returns the ID of the term.
 double getWeightExpansion()
          The method returns the expansion weight of the term.
 double getWithinDocumentFrequency()
          The method returns the frequency of the term in the X top-retrieved documents.
 void insertRecord(double _withinDocumentFrequency)
          If the term is found in another top-retrieved document, we increase the frequency and the document frequency of the term.
 void setWeightExpansion(double _weightExpansion)
          Sets the expansion weight of the term.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

termID

protected int termID
The term ID.


weightExpansion

protected double weightExpansion
The weight for query expansion.


withinDocumentFrequency

protected double withinDocumentFrequency
The number of occurrences of the given term in the X top ranked documents.


documentFrequency

protected int documentFrequency
The document frequency of the term in the X top ranked documents.

Constructor Detail

ExpansionTerms.ExpansionTerm

public ExpansionTerms.ExpansionTerm(int _termID,
                                    double _withinDocumentFrequency)
The constructor of ExpansionTerm. Once the term is found in a top- retrieved documents, we create a record for this term.

Parameters:
_termID - int the ID of the term
_withinDocumentFrequency - double the frequency of the term in a top-retrieved document
Method Detail

getTermID

public int getTermID()
Returns the ID of the term.

Returns:
int the term ID.

insertRecord

public void insertRecord(double _withinDocumentFrequency)
If the term is found in another top-retrieved document, we increase the frequency and the document frequency of the term.

Parameters:
_withinDocumentFrequency - double the frequency of the term in the corresponding top-retrieved document.

setWeightExpansion

public void setWeightExpansion(double _weightExpansion)
Sets the expansion weight of the term.

Parameters:
_weightExpansion - double the expansion weight of the term.

getDocumentFrequency

public int getDocumentFrequency()
The method returns the document frequency of term in the top-retrieved documents.

Returns:
int The document frequency of term in the top-retrieved documents.

getWeightExpansion

public double getWeightExpansion()
The method returns the expansion weight of the term.

Returns:
double The expansion weight of the term.

getWithinDocumentFrequency

public double getWithinDocumentFrequency()
The method returns the frequency of the term in the X top-retrieved documents.

Returns:
double The expansion weight of the term.


Terrier 3.5. Copyright © 2004-2011 University of Glasgow