iglu.ir
Class AbstractVectorCreator

java.lang.Object
  |
  +--iglu.ir.AbstractVectorCreator
All Implemented Interfaces:
VectorCreator
Direct Known Subclasses:
FrequencyVectorCreator, JDBCVectorCreator, OrderVectorCreator, PhraseFrequencyVectorCreator, TrainableVectorCreator

public abstract class AbstractVectorCreator
extends java.lang.Object
implements VectorCreator

Implements some of the functionality of the vector creator and provides a convienence method for making produced vectors conform to the user's limitations on them.

Author:
Travis Bauer, Ryan Scherle

Field Summary
private  TermVector dictionary
           
private  boolean linearlyScale
           
private  int maxSize
           
private  boolean normalize
           
 
Constructor Summary
AbstractVectorCreator()
           
 
Method Summary
protected  void cleanUp(TermVector candidate)
          Alter a vector to conform to the settings made here.
 void setDictionary(TermVector dict)
          Set a dictionary controlling the vocabulary allowed in this vector.
 void setLinearlyScale(boolean scale)
          Whether or not all returned vectors should be linearly scaled.
 void setMaxSize(int n)
          All returned vectors should be no longer than n
 void setNormalize(boolean normalize)
          Whether or not all vectors should be normalized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface iglu.ir.VectorCreator
getVector
 

Field Detail

dictionary

private TermVector dictionary

linearlyScale

private boolean linearlyScale

normalize

private boolean normalize

maxSize

private int maxSize
Constructor Detail

AbstractVectorCreator

public AbstractVectorCreator()
Method Detail

setDictionary

public void setDictionary(TermVector dict)
Set a dictionary controlling the vocabulary allowed in this vector. Only terms occuring in the dictionary will appear in the resultant vector.

Specified by:
setDictionary in interface VectorCreator

setLinearlyScale

public void setLinearlyScale(boolean scale)
Description copied from interface: VectorCreator
Whether or not all returned vectors should be linearly scaled.

Specified by:
setLinearlyScale in interface VectorCreator

setNormalize

public void setNormalize(boolean normalize)
Description copied from interface: VectorCreator
Whether or not all vectors should be normalized.

Specified by:
setNormalize in interface VectorCreator

setMaxSize

public void setMaxSize(int n)
Description copied from interface: VectorCreator
All returned vectors should be no longer than n

Specified by:
setMaxSize in interface VectorCreator

cleanUp

protected void cleanUp(TermVector candidate)
Alter a vector to conform to the settings made here. Subclasses of this class should run this method on their vector before returning it.

Parameters:
candidate - a TermVector value
Returns:
a TermVector value