Advise-me-0.1: Assessment services for the Advise-Me project

Maintainerbastiaan.heeren@ou.nl
Stabilityprovisional
Portabilityportable (depends on ghc)
Safe HaskellSafe
LanguageHaskell98

Recognize.Parsing.MathLexer

Description

This module defines the lexing (1st) phase of the assessment pipeline. The only function you should need is extract. Note that we don't do true lexing: we don't convert symbols into tokens. Instead, we mostly tend to remove text/symbols and do some conversion.

Synopsis

Documentation

extract :: StringLexerOptions -> String -> ([String], Bool) Source #

This is the lexer function.

It takes some options for string lexing, the string to lex and return a list of lines and a boolean denoting columnization.

useColumns :: StringLexerOptions -> String -> Maybe [[String]] Source #

Determines for a given string whether it should be parsed using columns Columns can occur in a horizontal or vertical fashion. Horizontal columns means that several expressions on a single line form one solution Vertical columns means that several expressions directly below another form one solution

parseColumns :: MathLexer [String] Source #

Parses several expressions on a single line

allowedWords :: MathLexer String Source #

Matches on expressions that may contain spaces. It currently does parse "60 60" as a single expression

trim :: String -> String Source #

drop spaces before and after