Package org.terrier.structures.indexing
Class FieldDocumentPostingList
- java.lang.Object
-
- org.terrier.structures.indexing.DocumentPostingList
-
- org.terrier.structures.indexing.FieldDocumentPostingList
-
- All Implemented Interfaces:
java.io.Serializable
,org.apache.hadoop.io.Writable
- Direct Known Subclasses:
BlockFieldDocumentPostingList
public class FieldDocumentPostingList extends DocumentPostingList
FieldDocumentPostingList class- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.terrier.structures.indexing.DocumentPostingList
DocumentPostingList.postingIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected gnu.trove.TObjectIntHashMap<java.lang.String>[]
field_occurrences
occurrences of terms in fieldsprotected int
fieldCount
number of fieldsprotected int[]
fieldLengths
length of each field-
Fields inherited from class org.terrier.structures.indexing.DocumentPostingList
AVG_DOCUMENT_UNIQUE_TERMS, documentLength, occurrences
-
-
Constructor Summary
Constructors Constructor Description FieldDocumentPostingList(int NUM_FIELDS)
constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Removes all postings from this documentDocumentIndexEntry
getDocumentStatistics()
Return a DocumentIndexEntry for this documentint[]
getFieldFrequencies(java.lang.String term)
Return the frequencies of the specified term in all of the fieldsint[][]
getPostings(TermCodes termCodes)
Returns the postings suitable to be written into the direct index.void
insert(int tf, java.lang.String term, int fieldNum)
Insert a term into the posting list of this document, in the given field, with the given frequencyvoid
insert(int tf, java.lang.String term, int[] fieldNums)
Insert a term into the posting list of this document, in the given fieldvoid
insert(java.lang.String term, int fieldNum)
Insert a term into the posting list of this document, in the given fieldvoid
insert(java.lang.String term, int[] fieldNums)
Insert a term into the posting list of this document, in the given fieldprotected IterablePosting
makePostingIterator(java.lang.String[] _terms, int[] termIds)
void
readFields(java.io.DataInput in)
void
write(java.io.DataOutput out)
-
Methods inherited from class org.terrier.structures.indexing.DocumentPostingList
forEachTerm, getDocumentLength, getFrequency, getNumberOfPointers, getPostings2, insert, insert, termSet
-
-
-
-
Method Detail
-
insert
public void insert(int tf, java.lang.String term, int fieldNum)
Insert a term into the posting list of this document, in the given field, with the given frequency- Parameters:
tf
- frequency of the term in this documentterm
- String form of termfieldNum
- fieldNumber it occurs in
-
insert
public void insert(java.lang.String term, int fieldNum)
Insert a term into the posting list of this document, in the given field- Parameters:
term
- the Term being insertedfieldNum
- the id of the field that the term was found in
-
insert
public void insert(java.lang.String term, int[] fieldNums)
Insert a term into the posting list of this document, in the given field- Parameters:
term
- the Term being insertedfieldNums
- the ids of the fields that the term was found in, starting from 0
-
insert
public void insert(int tf, java.lang.String term, int[] fieldNums)
Insert a term into the posting list of this document, in the given field- Parameters:
tf
- the frequency of the termterm
- the Term being insertedfieldNums
- the ids of the fields that the term was found in
-
getFieldFrequencies
public int[] getFieldFrequencies(java.lang.String term)
Return the frequencies of the specified term in all of the fields
-
getDocumentStatistics
public DocumentIndexEntry getDocumentStatistics()
Return a DocumentIndexEntry for this document- Overrides:
getDocumentStatistics
in classDocumentPostingList
-
clear
public void clear()
Description copied from class:DocumentPostingList
Removes all postings from this document- Overrides:
clear
in classDocumentPostingList
-
getPostings
public int[][] getPostings(TermCodes termCodes)
Description copied from class:DocumentPostingList
Returns the postings suitable to be written into the direct index. During this, TermIds are assigned.- Overrides:
getPostings
in classDocumentPostingList
-
makePostingIterator
protected IterablePosting makePostingIterator(java.lang.String[] _terms, int[] termIds)
- Overrides:
makePostingIterator
in classDocumentPostingList
-
readFields
public void readFields(java.io.DataInput in) throws java.io.IOException
- Specified by:
readFields
in interfaceorg.apache.hadoop.io.Writable
- Overrides:
readFields
in classDocumentPostingList
- Throws:
java.io.IOException
-
write
public void write(java.io.DataOutput out) throws java.io.IOException
- Specified by:
write
in interfaceorg.apache.hadoop.io.Writable
- Overrides:
write
in classDocumentPostingList
- Throws:
java.io.IOException
-
-