NaturalLanguageAlphabets-0.2.1.0: Simple scoring schemes for word alignments

Safe HaskellNone
LanguageHaskell2010

NLP.Scoring.Unigram.Import

Description

TODO normalization of characters! (though it might be better to do this not in the importer, but a normalization function)

Synopsis

Documentation

prettyErrorAndExit :: MonadIO m => ErrInfo -> m () Source #

This will prettyprint the error message and ungracefully exit

errorToString :: ErrInfo -> String Source #

Returns the error message, but will not exit.

pDefaults :: UnigramParser () Source #

Defaults are key-value pairs, of which there is only a small set.

pCharGroup :: UnigramParser () Source #

Gives a name to a set of characters we want to work with later on.

pSimilarity :: UnigramParser () Source #

Parses a similarity line and updates the scores for the pairs of characters.

pEquality :: UnigramParser () Source #

Parses an equality line and updates the scores for the pairs of characters.

data FstKSndL Source #

Constructors

FstK 
SndL 

pGrapheme :: (CharParsing p, TokenParsing p) => p Text Source #

Defines what a grapheme is. Basically, don't be a whitespace and don't start with $.

TODO we probably want to allow $ to stand for $.

pKnownCharGroup :: Unlined UnigramParser (HashSet Text) Source #

Returns the set of characters from a known character group

pExpansionOptions :: UnigramParser Text Source #

How we can expand a group with special functions.

setIdent :: HashSet Text -> Unlined UnigramParser Text Source #

TODO only insert warning, not error, after seeing a character again!

newtype P a Source #

This is just the trifecta parser, but with haskell-style comments enabled.

Constructors

P 

Fields

Instances
Monad P Source # 
Instance details

Defined in NLP.Scoring.Unigram.Import

Methods

(>>=) :: P a -> (a -> P b) -> P b #

(>>) :: P a -> P b -> P b #

return :: a -> P a #

fail :: String -> P a #

Functor P Source # 
Instance details

Defined in NLP.Scoring.Unigram.Import

Methods

fmap :: (a -> b) -> P a -> P b #

(<$) :: a -> P b -> P a #

Applicative P Source # 
Instance details

Defined in NLP.Scoring.Unigram.Import

Methods

pure :: a -> P a #

(<*>) :: P (a -> b) -> P a -> P b #

liftA2 :: (a -> b -> c) -> P a -> P b -> P c #

(*>) :: P a -> P b -> P b #

(<*) :: P a -> P b -> P a #

Alternative P Source # 
Instance details

Defined in NLP.Scoring.Unigram.Import

Methods

empty :: P a #

(<|>) :: P a -> P a -> P a #

some :: P a -> P [a] #

many :: P a -> P [a] #

MonadPlus P Source # 
Instance details

Defined in NLP.Scoring.Unigram.Import

Methods

mzero :: P a #

mplus :: P a -> P a -> P a #

TokenParsing P Source #

This enables the haskell-style comments.

Instance details

Defined in NLP.Scoring.Unigram.Import

Methods

someSpace :: P () #

nesting :: P a -> P a #

semi :: P Char #

highlight :: Highlight -> P a -> P a #

token :: P a -> P a #

CharParsing P Source # 
Instance details

Defined in NLP.Scoring.Unigram.Import

Methods

satisfy :: (Char -> Bool) -> P Char #

char :: Char -> P Char #

notChar :: Char -> P Char #

anyChar :: P Char #

string :: String -> P String #

text :: Text -> P Text #

Parsing P Source # 
Instance details

Defined in NLP.Scoring.Unigram.Import

Methods

try :: P a -> P a #

(<?>) :: P a -> String -> P a #

skipMany :: P a -> P () #

skipSome :: P a -> P () #

unexpected :: String -> P a #

eof :: P () #

notFollowedBy :: Show a => P a -> P () #

DeltaParsing P Source # 
Instance details

Defined in NLP.Scoring.Unigram.Import

DeltaParsing (Unlined UnigramParser) Source # 
Instance details

Defined in NLP.Scoring.Unigram.Import