edu.umass.cs.mallet.base.pipe
Class Csv2Array
java.lang.Object
edu.umass.cs.mallet.base.pipe.Pipe
edu.umass.cs.mallet.base.pipe.Csv2Array
- All Implemented Interfaces:
- 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
- See Also:
- Serialized Form
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 edu.umass.cs.mallet.base.pipe.Pipe |
getDataAlphabet, getInstanceId, getParent, getParentRoot, getTargetAlphabet, isDataAlphabetSet, isTargetProcessing, pipe, readResolve, resolveDataAlphabet, resolveTargetAlphabet, setDataAlphabet, setParent, setTargetAlphabet, setTargetProcessing |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Csv2Array
public Csv2Array()
Csv2Array
public Csv2Array(java.lang.String regex)
Csv2Array
public Csv2Array(CharSequenceLexer l)
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.
- Specified by:
pipe
in class Pipe
- Parameters:
carrier
- Instance to be processed.