Safe Haskell | None |
---|---|
Language | Haskell2010 |
TODO normalization of characters! (though it might be better to do this not in the importer, but a normalization function)
Synopsis
- data Env = Env {}
- warnings :: Lens' Env (Seq Text)
- matchScores :: Lens' Env (HashMap (Text, Text) Double)
- ignoredScoresSndL :: Lens' Env (HashMap Text Double)
- ignoredScoresFstK :: Lens' Env (HashMap Text Double)
- defaults :: Lens' Env (HashMap Text Double)
- charGroups :: Lens' Env (HashMap Text (HashSet Text))
- defaultEnv :: Env
- test :: IO (Either ErrInfo (UnigramScoring k3 l))
- prettyErrorAndExit :: MonadIO m => ErrInfo -> m ()
- errorToString :: ErrInfo -> String
- fromByteString :: ByteString -> String -> Except ErrInfo (UnigramScoring k l)
- fromFile :: Bool -> FilePath -> ExceptT ErrInfo IO (UnigramScoring k l)
- pUnigram :: UnigramParser (UnigramScoring k l)
- pDefaults :: UnigramParser ()
- pCharGroup :: UnigramParser ()
- pSimilarity :: UnigramParser ()
- pEquality :: UnigramParser ()
- data FstKSndL
- pIgnored :: UnigramParser ()
- pGrapheme :: (CharParsing p, TokenParsing p) => p Text
- pKnownCharGroup :: Unlined UnigramParser (HashSet Text)
- pExpansionOptions :: UnigramParser Text
- specialFunctions :: [(Text, Text -> Text)]
- applySpecialFunctions :: Foldable t => t Text -> HashSet Text -> HashSet Text
- setIdent :: HashSet Text -> Unlined UnigramParser Text
- reserved :: TokenParsing m => IdentifierStyle m
- newtype P a = P {}
- type UnigramParser = StateT Env P
Documentation
Instances
Show Env Source # | |
DeltaParsing (Unlined UnigramParser) Source # | |
Defined in NLP.Scoring.Unigram.Import line :: Unlined UnigramParser ByteString # position :: Unlined UnigramParser Delta # slicedWith :: (a -> ByteString -> r) -> Unlined UnigramParser a -> Unlined UnigramParser r # |
defaultEnv :: Env Source #
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.
fromByteString :: ByteString -> String -> Except ErrInfo (UnigramScoring k l) Source #
pUnigram :: UnigramParser (UnigramScoring k l) Source #
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.
pIgnored :: UnigramParser () Source #
pGrapheme :: (CharParsing p, TokenParsing p) => p Text Source #
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!
reserved :: TokenParsing m => IdentifierStyle m Source #
This is just the trifecta parser, but with haskell-style comments enabled.
Instances
Monad P Source # | |
Functor P Source # | |
Applicative P Source # | |
Alternative P Source # | |
MonadPlus P Source # | |
TokenParsing P Source # | This enables the haskell-style comments. |
CharParsing P Source # | |
Parsing P Source # | |
DeltaParsing P Source # | |
Defined in NLP.Scoring.Unigram.Import line :: P ByteString # slicedWith :: (a -> ByteString -> r) -> P a -> P r # restOfLine :: P ByteString # | |
DeltaParsing (Unlined UnigramParser) Source # | |
Defined in NLP.Scoring.Unigram.Import line :: Unlined UnigramParser ByteString # position :: Unlined UnigramParser Delta # slicedWith :: (a -> ByteString -> r) -> Unlined UnigramParser a -> Unlined UnigramParser r # |