cc.mallet.pipe
Class Csv2Array

java.lang.Object
  extended by cc.mallet.pipe.Pipe
      extended by cc.mallet.pipe.Csv2Array
All Implemented Interfaces:
AlphabetCarrying, java.io.Serializable

public class Csv2Array
extends Pipe

Converts a string of comma separated values to an array. To be used prior to Array2FeatureVector. Note that this class assumes that each location of the line corresponds to a feature index (i.e. "dense" representation) eg: instance 1: 1,0,0,1,0,0,1 << feature alphabet size = 7 instance 2: 0,0,1,0,0,0,1 << feature alphabet size = 7

Author:
Aron Culotta
See Also:
Serialized Form

Constructor Summary
Csv2Array()
           
Csv2Array(CharSequenceLexer l)
           
Csv2Array(java.lang.String regex)
           
 
Method Summary
 Instance pipe(Instance carrier)
          Convert the data in an Instance from a CharSequence of comma-separated-values to an array, where each index is the feature name.
 
Methods inherited from class cc.mallet.pipe.Pipe
alphabetsMatch, getAlphabet, getAlphabets, getDataAlphabet, getInstanceId, getTargetAlphabet, instanceFrom, instancesFrom, instancesFrom, isDataAlphabetSet, isTargetProcessing, newIteratorFrom, preceedingPipeDataAlphabetNotification, preceedingPipeTargetAlphabetNotification, precondition, readResolve, setDataAlphabet, setOrCheckDataAlphabet, setOrCheckTargetAlphabet, setTargetAlphabet, setTargetProcessing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Csv2Array

public Csv2Array()

Csv2Array

public Csv2Array(java.lang.String regex)

Csv2Array

public Csv2Array(CharSequenceLexer l)
Method Detail

pipe

public Instance pipe(Instance carrier)
Convert the data in an Instance from a CharSequence of comma-separated-values to an array, where each index is the feature name.

Overrides:
pipe in class Pipe