partage-0.1.0.1: Parsing factorized

Safe HaskellSafe
LanguageHaskell2010

NLP.Partage.Gen

Contents

Description

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.

Synopsis

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.

data GenConf Source

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.

Constructors

GenConf 

Fields

genAllSize :: Int

Generate all derivable trees up to the given size

adjProb :: Double

Adjunction probability