edu.stanford.nlp.dbm
Class LabelMatrix

java.lang.Object
  |
  +--edu.stanford.nlp.dbm.LabelMatrix
All Implemented Interfaces:
MatrixWrapper

public class LabelMatrix
extends Object
implements MatrixWrapper

Wrapper for a Matrix whose columns are Label Vectors of Labeled Objects


Field Summary
protected  IndexedSet labels
           
protected  GrowableMatrix matrix
           
 
Constructor Summary
LabelMatrix(GrowableMatrix matrix, IndexedSet labels)
           
LabelMatrix(String matrixfile, IndexedSet labels)
           
 
Method Summary
 int add(Labeled t)
          inserts Labeled Object into LabelMatrix, and returns its index
 List getLabels()
           
 Matrix getMatrix()
          Returns underlying Matrix
 Array insert(Iterator iter)
          creates boolean vector.
 Array toLabelVector(Labeled t)
          inserts a Labeled object into the LabelMatrix, and returns the inserted LabelVector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

matrix

protected GrowableMatrix matrix

labels

protected IndexedSet labels
Constructor Detail

LabelMatrix

public LabelMatrix(GrowableMatrix matrix,
                   IndexedSet labels)

LabelMatrix

public LabelMatrix(String matrixfile,
                   IndexedSet labels)
            throws IOException,
                   FileNotFoundException
Method Detail

insert

public Array insert(Iterator iter)
             throws IOException
creates boolean vector. assigns entry[i]=1 if iterator contains object with index i and 0 if it doesn't.

IOException

toLabelVector

public Array toLabelVector(Labeled t)
                    throws IOException
inserts a Labeled object into the LabelMatrix, and returns the inserted LabelVector

IOException

add

public int add(Labeled t)
        throws IOException
inserts Labeled Object into LabelMatrix, and returns its index

IOException

getLabels

public List getLabels()

getMatrix

public Matrix getMatrix()
Description copied from interface: MatrixWrapper
Returns underlying Matrix

Specified by:
getMatrix in interface MatrixWrapper


Stanford NLP Group