Package elki.datasource.parser
Class BitVectorLabelParser
- java.lang.Object
-
- elki.datasource.parser.AbstractStreamingParser
-
- elki.datasource.parser.NumberVectorLabelParser<BitVector>
-
- elki.datasource.parser.BitVectorLabelParser
-
- All Implemented Interfaces:
BundleStreamSource
,Parser
,StreamingParser
@Title("Bit Vector Label Parser") @Description("Parses the following format of lines:\nA single line provides a single BitVector. Bits are separated by whitespace. Any substring not containing whitespace is tried to be read as Bit. If this fails, it will be appended to a label. (Thus, any label must not be parseable as Bit.) Empty lines and lines beginning with \"#\" will be ignored.") public class BitVectorLabelParser extends NumberVectorLabelParser<BitVector>
Parser for parsing one BitVector per line, bits separated by whitespace.Several labels may be given per BitVector. A label must not be parseable as Bit. Lines starting with "#" will be ignored.
- Since:
- 0.1
- Author:
- Arthur Zimek
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BitVectorLabelParser.Par
Parameterization class.-
Nested classes/interfaces inherited from interface elki.datasource.bundle.BundleStreamSource
BundleStreamSource.Event
-
-
Field Summary
Fields Modifier and Type Field Description (package private) it.unimi.dsi.fastutil.longs.LongArrayList
buf
Buffer, will be reused.private static Logging
LOG
Class logger-
Fields inherited from class elki.datasource.parser.NumberVectorLabelParser
attributes, columnnames, curlbl, curvec, factory, haslabels, labels, maxdim, meta, mindim, nextevent, unique, warnedDim, warnedPrecision
-
Fields inherited from class elki.datasource.parser.AbstractStreamingParser
reader, tokenizer
-
-
Constructor Summary
Constructors Constructor Description BitVectorLabelParser(CSVReaderFormat format)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Logging
getLogger()
Get the logger for this class.protected boolean
parseLineInternal()
Internal method for parsing a single line.-
Methods inherited from class elki.datasource.parser.NumberVectorLabelParser
buildMeta, cleanup, createVector, data, getMeta, getTypeInformation, initStream, isLabelColumn, nextEvent
-
Methods inherited from class elki.datasource.parser.AbstractStreamingParser
asMultipleObjectsBundle, assignDBID, hasDBIDs, parse
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger
-
buf
it.unimi.dsi.fastutil.longs.LongArrayList buf
Buffer, will be reused.
-
-
Constructor Detail
-
BitVectorLabelParser
public BitVectorLabelParser(CSVReaderFormat format)
Constructor.- Parameters:
format
- Input format
-
-
Method Detail
-
parseLineInternal
protected boolean parseLineInternal()
Description copied from class:NumberVectorLabelParser
Internal method for parsing a single line. Used by both line based parsing as well as block parsing. This saves the building of meta data for each line.- Overrides:
parseLineInternal
in classNumberVectorLabelParser<BitVector>
- Returns:
true
when a valid line was read,false
on a label row.
-
getLogger
protected Logging getLogger()
Description copied from class:AbstractStreamingParser
Get the logger for this class.- Overrides:
getLogger
in classNumberVectorLabelParser<BitVector>
- Returns:
- Logger.
-
-