@Title(value="Term frequency parser") @Description(value="Parse a file containing term frequencies. The expected format is \'label term1term2 ...\'. Terms must not contain the separator character!") public class TermFrequencyParser extends NumberVectorLabelParser<SparseFloatVector>
Modifier and Type | Class and Description |
---|---|
static class |
TermFrequencyParser.Parameterizer
Parameterization class.
|
BundleStreamSource.Event
Modifier and Type | Field and Description |
---|---|
(package private) HashMap<String,Integer> |
keymap
Map
|
private static Logging |
logger
Class logger
|
(package private) int |
maxdim
Maximum dimension used
|
(package private) boolean |
normalize
Normalize
|
curlbl, curvec, dimensionality, DIMENSIONALITY_UNKNOWN, DIMENSIONALITY_VARIABLE, factory, LABEL_INDICES_ID, labelIndices, lineNumber, meta, nextevent, VECTOR_TYPE_ID
ATTRIBUTE_CONCATENATION, COLUMN_SEPARATOR_ID, COMMENT, NUMBER_PATTERN, QUOTE_CHAR, QUOTE_ID, quoteChar, WHITESPACE_PATTERN
Constructor and Description |
---|
TermFrequencyParser(boolean normalize,
Pattern colSep,
char quoteChar,
BitSet labelIndices)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected Logging |
getLogger()
Get the logger for this class.
|
protected SimpleTypeInformation<SparseFloatVector> |
getTypeInformation(int dimensionality)
Get a prototype object for the given dimensionality.
|
protected void |
parseLineInternal(String line)
Internal method for parsing a single line.
|
buildMeta, createDBObject, data, getMeta, initStream, nextEvent
parse
tokenize, toString
private static final Logging logger
int maxdim
boolean normalize
protected void parseLineInternal(String line)
NumberVectorLabelParser
parseLineInternal
in class NumberVectorLabelParser<SparseFloatVector>
line
- Line to processprotected SimpleTypeInformation<SparseFloatVector> getTypeInformation(int dimensionality)
NumberVectorLabelParser
getTypeInformation
in class NumberVectorLabelParser<SparseFloatVector>
dimensionality
- Dimensionalityprotected Logging getLogger()
AbstractParser
getLogger
in class NumberVectorLabelParser<SparseFloatVector>