attoparsec-arff-0.0: An ARFF file parser using Attoparsec

Safe HaskellSafe-Infered




data Attribute Source




data Header Source

Represents the entire header




title :: ByteString

Name of the relation (@RELATION foo)

attributes :: [Attribute]

Mapping of indexes to values


data AttributeValue Source

Value of a single attribute in a single row


before :: Parser p1 -> Parser p2 -> Parser p1Source

Parse two expressions sequentially, returning the result of the first.

isInlineSpace :: Char -> BoolSource

matches non-newline space characters

lineSpace :: Parser ()Source

Parses a sequence of non-newline space characters

lineEnd :: Parser ()Source

Matches what should be the end of the line- optional comment then newline.

identifier :: Parser ByteStringSource

identifier parses arguments to \@ directives, e.g. @RELATION foo TODO: Check these rules against the spec! TODO: Allow quoted identifiers with spaces inside.

relation :: Parser ByteStringSource

Parse the title of the relation

attributeType :: Parser AttributeTypeSource

Parse the attribute type: @ATTRIBUTE name type

attribute :: Parser AttributeSource

Parse an attribute: @ATTRIBUTE Name Type

line :: Parser p -> Parser pSource

Parses the next expected line

header :: Parser HeaderSource

Parse an ARFF header.

value' :: AttributeType -> Parser AttributeValueSource

Parse a value of the expected type (not handling missings)

value :: AttributeType -> Parser (Maybe AttributeValue)Source

Parse a value of the expected type, returning Nothing for missing values

row :: [AttributeType] -> Parser [Maybe AttributeValue]Source

Create a parser which parses a single row of AttributeValues, expecting each to be in order of the Attributes supplied.

rows :: Header -> Parser [[Maybe AttributeValue]]Source

Parse all data rows in the file.

arff :: Parser (Header, [[Maybe AttributeValue]])Source

Parse a tuple of Header data and a list of rows, composed of values or Nothing (for missing- ?- values).