com.sun.labs.minion.retrieval
Class PassageStore

java.lang.Object
  extended by com.sun.labs.minion.retrieval.PassageStore

public class PassageStore
extends java.lang.Object

A class to store the passages for a single field while doing proximity queries or passage highlighting.


Field Summary
protected  ArrayGroup ag
          The array group that we're associated with.
protected  int nPass
          The number of passages stored in the pass array.
protected  int[] pass
           
protected  int[] passEndPosns
          The ending positions in the passages array for the passages for a given document.
protected  int passPosn
          The current position in the passages array.
protected  int[] passStartPosns
          The starting positions in the passages array for the passages for a given document.
protected  float[] penalties
          The penalties associated with each of the passsages.
protected  int width
          The width of the passages that we're storing.
 
Constructor Summary
PassageStore(ArrayGroup ag)
          Instantiates a passage store.
 
Method Summary
 void add(int pos, int[] p, float penalty)
          Adds a passage to this passage store.
protected  int[] getAllPassages(int doc)
          Gets all of the passages associated with a document as a single array of int.
protected  float[] getPenalties(int doc)
           
protected  float getPenalty(int doc)
           
protected  int[][] getUniquePassages(int doc)
           
 java.lang.String toString(int doc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ag

protected ArrayGroup ag
The array group that we're associated with.


pass

protected int[] pass

passStartPosns

protected int[] passStartPosns
The starting positions in the passages array for the passages for a given document. This array will correspond to the docs array in an ArrayGroup.


passEndPosns

protected int[] passEndPosns
The ending positions in the passages array for the passages for a given document. This array will correspond to the docs array in an ArrayGroup.


penalties

protected float[] penalties
The penalties associated with each of the passsages.


passPosn

protected int passPosn
The current position in the passages array.


nPass

protected int nPass
The number of passages stored in the pass array.


width

protected int width
The width of the passages that we're storing.

Constructor Detail

PassageStore

public PassageStore(ArrayGroup ag)
Instantiates a passage store.

Parameters:
ag - The array group that we're associated with.
Method Detail

add

public void add(int pos,
                int[] p,
                float penalty)
Adds a passage to this passage store.

Parameters:
pos - The position to which the passage should be added.
p - The passage to add.

getAllPassages

protected int[] getAllPassages(int doc)
Gets all of the passages associated with a document as a single array of int.


getPenalty

protected float getPenalty(int doc)

getUniquePassages

protected int[][] getUniquePassages(int doc)

getPenalties

protected float[] getPenalties(int doc)

toString

public java.lang.String toString(int doc)