org.terrier.structures.indexing
Class FieldDocumentPostingList

java.lang.Object
  extended by org.terrier.structures.indexing.DocumentPostingList
      extended by org.terrier.structures.indexing.FieldDocumentPostingList
Direct Known Subclasses:
BlockFieldDocumentPostingList

public class FieldDocumentPostingList
extends DocumentPostingList

FieldDocumentPostingList class


Nested Class Summary
 
Nested classes/interfaces inherited from class org.terrier.structures.indexing.DocumentPostingList
DocumentPostingList.postingIterator
 
Field Summary
protected  gnu.trove.TObjectIntHashMap<String>[] field_occurrences
          occurrences of terms in fields
protected  int fieldCount
          number of fields
protected  int[] fieldLengths
          length of each field
 
Fields inherited from class org.terrier.structures.indexing.DocumentPostingList
AVG_DOCUMENT_UNIQUE_TERMS, documentLength, occurrences
 
Constructor Summary
FieldDocumentPostingList(int NUM_FIELDS)
          constructor
 
Method Summary
 void clear()
          Removes all postings from this document
 DocumentIndexEntry getDocumentStatistics()
          Return a DocumentIndexEntry for this document
 int[] getFieldFrequencies(String term)
          Return the frequencies of the specified term in all of the fields
 int[][] getPostings()
          Returns the postings suitable to be written into the direct index.
 void insert(int tf, String term, int fieldNum)
          Insert a term into the posting list of this document, in the given field, with the given frequency
 void insert(int tf, String term, int[] fieldNums)
          Insert a term into the posting list of this document, in the given field
 void insert(String term, int fieldNum)
          Insert a term into the posting list of this document, in the given field
 void insert(String term, int[] fieldNums)
          Insert a term into the posting list of this document, in the given field
protected  IterablePosting makePostingIterator(String[] _terms, int[] termIds)
           
 
Methods inherited from class org.terrier.structures.indexing.DocumentPostingList
forEachTerm, getDocumentLength, getFrequency, getNumberOfPointers, getPostings2, getTermId, insert, insert, termSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldCount

protected final int fieldCount
number of fields


fieldLengths

protected final int[] fieldLengths
length of each field


field_occurrences

protected final gnu.trove.TObjectIntHashMap<String>[] field_occurrences
occurrences of terms in fields

Constructor Detail

FieldDocumentPostingList

public FieldDocumentPostingList(int NUM_FIELDS)
constructor

Parameters:
NUM_FIELDS -
Method Detail

insert

public void insert(int tf,
                   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 document
term - String form of term
fieldNum - fieldNumber it occurs in

insert

public void insert(String term,
                   int fieldNum)
Insert a term into the posting list of this document, in the given field

Parameters:
term - the Term being inserted
fieldNum - the id of the field that the term was found in

insert

public void insert(String term,
                   int[] fieldNums)
Insert a term into the posting list of this document, in the given field

Parameters:
term - the Term being inserted
fieldNums - the ids of the fields that the term was found in, starting from 0

insert

public void insert(int tf,
                   String term,
                   int[] fieldNums)
Insert a term into the posting list of this document, in the given field

Parameters:
tf - the frequency of the term
term - the Term being inserted
fieldNums - the ids of the fields that the term was found in

getFieldFrequencies

public int[] getFieldFrequencies(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 class DocumentPostingList

clear

public void clear()
Description copied from class: DocumentPostingList
Removes all postings from this document

Overrides:
clear in class DocumentPostingList

getPostings

public int[][] getPostings()
Description copied from class: DocumentPostingList
Returns the postings suitable to be written into the direct index. During this, TermIds are assigned.

Overrides:
getPostings in class DocumentPostingList

makePostingIterator

protected IterablePosting makePostingIterator(String[] _terms,
                                              int[] termIds)
Overrides:
makePostingIterator in class DocumentPostingList


Terrier 3.6. Copyright © 2004-2011 University of Glasgow