|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terrier.structures.indexing.DocumentPostingList
public class DocumentPostingList
Represents the postings of one document. Uses HashMaps internally.
Properties:
| Nested Class Summary | |
|---|---|
protected class |
DocumentPostingList.postingIterator
|
| Field Summary | |
|---|---|
protected static int |
AVG_DOCUMENT_UNIQUE_TERMS
number of unique terms per doc on average, used to tune the initial size of the hashmaps used in this class. |
protected int |
documentLength
length of the document so far. |
protected gnu.trove.TObjectIntHashMap<java.lang.String> |
occurrences
mapping term to tf mapping |
| Constructor Summary | |
|---|---|
DocumentPostingList()
Create a new DocumentPostingList object |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all postings from this document |
void |
forEachTerm(gnu.trove.TObjectIntProcedure<java.lang.String> proc)
Execute the specifed method for each term. |
int |
getDocumentLength()
Returns the total number of tokens in this document |
DocumentIndexEntry |
getDocumentStatistics()
Return a DocumentIndexEntry for this document |
int |
getFrequency(java.lang.String term)
Return the frequency of the specified term in this document |
int |
getNumberOfPointers()
Returns the number of unique terms in this document. |
int[][] |
getPostings()
Returns the postings suitable to be written into the direct index. |
IterablePosting |
getPostings2()
Returns a posting iterator suitable to be written into the direct index. |
protected int |
getTermId(java.lang.String term)
Used by getPostings() and getPostings2() to obtain the term id of the term. |
void |
insert(int tf,
java.lang.String term)
Insert a term into the posting list of this document |
void |
insert(java.lang.String term)
Insert a term into the posting list of this document |
protected IterablePosting |
makePostingIterator(java.lang.String[] _terms,
int[] termIds)
|
java.lang.String[] |
termSet()
Returns all terms in this posting list |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int AVG_DOCUMENT_UNIQUE_TERMS
protected int documentLength
protected final gnu.trove.TObjectIntHashMap<java.lang.String> occurrences
| Constructor Detail |
|---|
public DocumentPostingList()
| Method Detail |
|---|
public java.lang.String[] termSet()
public int getFrequency(java.lang.String term)
public void clear()
public int getDocumentLength()
public int getNumberOfPointers()
public void insert(java.lang.String term)
term - the Term being inserted
public void insert(int tf,
java.lang.String term)
tf - frequencyterm - the Term being insertedpublic DocumentIndexEntry getDocumentStatistics()
public void forEachTerm(gnu.trove.TObjectIntProcedure<java.lang.String> proc)
protected int getTermId(java.lang.String term)
public int[][] getPostings()
public IterablePosting getPostings2()
protected IterablePosting makePostingIterator(java.lang.String[] _terms,
int[] termIds)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||