Package org.terrier.querying
Class ExpansionTerms.ExpansionTerm
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description 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
Constructors Constructor Description ExpansionTerm(int _termID, double _withinDocumentFrequency)
The constructor of ExpansionTerm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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
-
ExpansionTerm
public 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.
-
-