Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
A simple, experimental tree generation module, with the aim to generate all, or randomly, language trees satisfying certain simple constraints.
One of the possible usecases where such a functionality can be useful is to automatically generate test sets over which efficiency of a parser can be measured.
Documentation
type Gram n t = Set (Tree n t) Source
A TAG grammar: a set of (elementary) initial and auxiliary trees.
Generation
generateAll :: (MonadIO m, Ord n, Ord t) => Gram n t -> Int -> Producer (Tree n t) m () Source
Generate all trees derivable from the given grammar up to the given size.
Randomized generation
generateRand :: (MonadIO m, Ord n, Ord t) => Gram n t -> GenConf -> Producer (Tree n t) m () Source
Randomly generate derived trees from the grammar, according to the given configuration.
Randomized generation configuration.
First all derivable trees up to the size genAllSize
are
generated, and on this basis other derived trees (with adjunction
probability controlled by adjProb
) are constructed.
GenConf | |
|