Portability | portable |
---|---|
Stability | experimental |
Maintainer | eric.kow@gmail.com |
Safe Haskell | Safe-Infered |
NLP.Antfarm.Demo
Description
Helper functions for the antfarm demonstrator. You probably don't want to import this module unless you're doing something amusing like making a web app out of the antfarm demonstrator. But it could be useful to look at the source if you're making something using antfarm
- decode :: String -> Either ParseError [[DiscourseUnit]]
- decodeRx :: String -> Either ParseError [DiscourseUnit]
- type RefStateT m a = StateT RefHistory m a
- type RefState a = RefStateT Identity a
- nextRx :: Monad m => [DiscourseUnit] -> RefStateT m Text
- itemToClass :: Text -> Text
- isClassWide :: Text -> Bool
- stripNonClassStuff :: Text -> Text
- lexMap :: [(Text, Text)]
- onWords :: (Text -> Maybe Text) -> Text -> Text
- intercalateRx :: [Text] -> Text
- data DemoElem = DemoElem {}
- data Constr
- = Constr Constraint
- | Inst Text
- | ClassWide
- fromDemoElem :: DemoElem -> RefGroup
- mergeGroups :: [RefGroup] -> RefGroup
- fromDemoForest :: [Tree DemoElem] -> [DiscourseUnit]
- toSubRxInput :: DiscourseUnit -> Tree SubRxInput
- pFilled :: Parser a -> Parser a
- pSentence :: Parser [[Tree DemoElem]]
- pDemoElemForest :: Parser [Tree DemoElem]
- pDemoElemTree :: Parser (Tree DemoElem)
- pDemoElem :: Parser DemoElem
- pConstr :: Parser Constraint
- opTable :: [(Int -> Constraint, [Text])]
- pLexeme :: Parser Text
- pOp :: Parser Text
- pNatural :: Parser Int
- class Pretty a where
- parens :: Text -> Text
- squares :: Text -> Text
- prettyForest :: Pretty a => [Tree a] -> Text
- prettyTree :: Pretty a => Tree a -> Text
- buckets :: Ord b => (a -> b) -> [a] -> [(b, [a])]
- onSubTrees :: (Tree a -> b) -> Tree a -> Tree b
Documentation
decode :: String -> Either ParseError [[DiscourseUnit]]Source
type RefStateT m a = StateT RefHistory m aSource
itemToClass :: Text -> TextSource
isClassWide :: Text -> BoolSource
stripNonClassStuff :: Text -> TextSource
intercalateRx :: [Text] -> TextSource
mergeGroups :: [RefGroup] -> RefGroupSource
fromDemoForest :: [Tree DemoElem] -> [DiscourseUnit]Source
Regroup constraints and examples so that like are with like
a1 b3 a4 ==> [a1 a4] [b3] a1 b3 a4 (x <= 3) b6 ==> [a1 a4]([x <= 3]) [b3 b6] a1 b3 a4 (x <= 3) b6 (y >= 8) a <= 1 (x >= 8) ==> [a1 a4]([x <= 3 >= 8]) [b3 b6]([y>=8])
opTable :: [(Int -> Constraint, [Text])]Source
prettyForest :: Pretty a => [Tree a] -> TextSource
prettyTree :: Pretty a => Tree a -> TextSource
onSubTrees :: (Tree a -> b) -> Tree a -> Tree bSource