Terrier IR Platform
2.2.1

uk.ac.gla.terrier.structures.indexing
Class DocumentPostingList

java.lang.Object
  extended by uk.ac.gla.terrier.structures.indexing.DocumentPostingList
Direct Known Subclasses:
BlockDocumentPostingList

public class DocumentPostingList
extends java.lang.Object

Represents the postings of one document. Uses HashMaps internally.

Properties:


Constructor Summary
DocumentPostingList()
          Make a new postings list for a document.
DocumentPostingList(int fieldCount)
          Make a new postings list for a document, with the specified number of fields
 
Method Summary
 void clear()
          Removes all postings from this document
 int getDocumentLength()
          Returns the total number of tokens in this document
 int getFields(java.lang.String term)
           
 int getFrequency(java.lang.String term)
           
 int getNumberOfPointers()
          Returns the number of unique terms in this document.
 int[][] getPostings()
          returns the postings suitable to be written into the direct index
 void insert(int tf, java.lang.String term)
          Insert a term into the posting list of this document
 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
 void insert(int tf, java.lang.String term, int[] fieldNums)
          Insert a term into the posting list of this document, in the given field
 void insert(java.lang.String term)
          Insert a term into the posting list of this document
 void insert(java.lang.String term, int fieldNum)
          Insert a term into the posting list of this document, in the given field
 void insert(java.lang.String term, int[] fieldNums)
          Insert a term into the posting list of this document, in the given field
 java.lang.String[] termSet()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentPostingList

public DocumentPostingList()
Make a new postings list for a document. No fields


DocumentPostingList

public DocumentPostingList(int fieldCount)
Make a new postings list for a document, with the specified number of fields

Parameters:
fieldCount - number of fields marked in this index
Method Detail

termSet

public java.lang.String[] termSet()

getFrequency

public int getFrequency(java.lang.String term)

getFields

public int getFields(java.lang.String term)

clear

public void clear()
Removes all postings from this document


getDocumentLength

public int getDocumentLength()
Returns the total number of tokens in this document


getNumberOfPointers

public int getNumberOfPointers()
Returns the number of unique terms in this document.


insert

public void insert(java.lang.String term)
Insert a term into the posting list of this document

Parameters:
term - the Term being inserted

insert

public void insert(int tf,
                   java.lang.String term)
Insert a term into the posting list of this document

Parameters:
tf - frequency
term - the Term being inserted

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 document
term - String form of term
fieldNum - fieldNumber it occurrs 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 inserted
fieldNum - 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 inserted
fieldNums - the ids of the fields that the term was found in

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 term
term - the Term being inserted
fieldNums - the ids of the fields that the term was found in

getPostings

public int[][] getPostings()
returns the postings suitable to be written into the direct index


Terrier IR Platform
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow