- data ProgState = ST {}
- type ProgStateRef = IORef ProgState
- emptyProgState :: Params -> ProgState
- showRealisations :: [String] -> String
- groupAndCount :: (Eq a, Ord a) => [a] -> [(a, Int)]
- initGeni :: ProgStateRef -> IO Input
- runGeni :: ProgStateRef -> Builder st it Params -> IO ([GeniResult], Statistics, st)
- runGeniWithSelector :: ProgStateRef -> Selector -> Builder st it Params -> IO ([GeniResult], Statistics, st)
- getTraces :: ProgState -> String -> [String]
- type GeniResult = (String, Derivation)
- type Selector = ProgState -> IO ([TagElem], [ILexEntry])
- loadEverything :: ProgStateRef -> IO ()
- loadLexicon :: ProgStateRef -> IO ()
- loadGeniMacros :: ProgStateRef -> IO ()
- loadTestSuite :: ProgStateRef -> IO ()
- loadTargetSemStr :: ProgStateRef -> String -> IO ()
- combine :: Macros -> Lexicon -> Tags
- chooseLexCand :: Lexicon -> Sem -> [ILexEntry]
Documentation
ST | |
|
type ProgStateRef = IORef ProgStateSource
emptyProgState :: Params -> ProgStateSource
The program state when you start GenI for the very first time
showRealisations :: [String] -> StringSource
Show the sentences produced by the generator, in a relatively compact form
groupAndCount :: (Eq a, Ord a) => [a] -> [(a, Int)]Source
Convert a list of items into a list of tuples (a,b) where a is an item in the list and b is the number of times a in occurs in the list.
initGeni :: ProgStateRef -> IO InputSource
initGeni
performs lexical selection and strips the input semantics of
any morpohological literals
runGeni :: ProgStateRef -> Builder st it Params -> IO ([GeniResult], Statistics, st)Source
Returns a list of sentences, a set of Statistics, and the generator state. The generator state is mostly useful for debugging via the graphical interface. Note that we assumes that you have already loaded in your grammar and parsed your input semantics.
runGeniWithSelector :: ProgStateRef -> Selector -> Builder st it Params -> IO ([GeniResult], Statistics, st)Source
getTraces :: ProgState -> String -> [String]Source
getTraces
is most likely useful for grammars produced by a
metagrammar system. Given a tree name, we retrieve the `trace'
information from the grammar for all trees that have this name. We
assume the tree name was constructed by GenI; see the source code for
details.
type GeniResult = (String, Derivation)Source
type Selector = ProgState -> IO ([TagElem], [ILexEntry])Source
Only used for instances of GenI where the grammar is compiled directly into GenI.
loadEverything :: ProgStateRef -> IO ()Source
loadLexicon :: ProgStateRef -> IO ()Source
loadGeniMacros :: ProgStateRef -> IO ()Source
loadTestSuite :: ProgStateRef -> IO ()Source
The macros are stored as a hashing function in the monad.
The results are stored as a lookup function in the monad.
Stores the results in the tcase and tsuite fields
loadTargetSemStr :: ProgStateRef -> String -> IO ()Source
Updates program state the same way as loadTestSuite
chooseLexCand :: Lexicon -> Sem -> [ILexEntry]Source
Select and returns the set of entries from the lexicon whose semantics subsumes the input semantics.