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_occurrencesoccurrences of terms in fieldsprotected intfieldCountnumber of fieldsprotected int[]fieldLengthslength 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 voidclear()Removes all postings from this documentDocumentIndexEntrygetDocumentStatistics()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.voidinsert(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 frequencyvoidinsert(int tf, java.lang.String term, int[] fieldNums)Insert a term into the posting list of this document, in the given fieldvoidinsert(java.lang.String term, int fieldNum)Insert a term into the posting list of this document, in the given fieldvoidinsert(java.lang.String term, int[] fieldNums)Insert a term into the posting list of this document, in the given fieldprotected IterablePostingmakePostingIterator(java.lang.String[] _terms, int[] termIds)voidreadFields(java.io.DataInput in)voidwrite(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:
getDocumentStatisticsin classDocumentPostingList
-
clear
public void clear()
Description copied from class:DocumentPostingListRemoves all postings from this document- Overrides:
clearin classDocumentPostingList
-
getPostings
public int[][] getPostings(TermCodes termCodes)
Description copied from class:DocumentPostingListReturns the postings suitable to be written into the direct index. During this, TermIds are assigned.- Overrides:
getPostingsin classDocumentPostingList
-
makePostingIterator
protected IterablePosting makePostingIterator(java.lang.String[] _terms, int[] termIds)
- Overrides:
makePostingIteratorin classDocumentPostingList
-
readFields
public void readFields(java.io.DataInput in) throws java.io.IOException- Specified by:
readFieldsin interfaceorg.apache.hadoop.io.Writable- Overrides:
readFieldsin classDocumentPostingList- Throws:
java.io.IOException
-
write
public void write(java.io.DataOutput out) throws java.io.IOException- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Overrides:
writein classDocumentPostingList- Throws:
java.io.IOException
-
-