GenI-0.24.2: A natural language generator (specifically, an FB-LTAG surface realiser)

Safe HaskellNone





Entry point

type PolAut = NFA PolState PolTransSource

data PolState Source


PolSt Int [Literal GeniVal] [(Int, Int)]

position in the input semantics, extra semantics, polarity interval

data PolResult Source

intermediate auts, seed aut, final aut, potentially modified sem





:: Set PolarityAttr

polarities to detect (eg. cat)

-> FeatStruct GeniVal

root features to compensate for

-> PolMap

explicit extra polarities

-> SemInput

input semantics

-> [TagElem]

lexical selection

-> PolResult 

Constructs a polarity automaton. For debugging purposes, it returns all the intermediate automata produced by the construction algorithm.

Polarity paths

detectPolPaths :: [[TagElem]] -> [(TagElem, PolPathSet)]Source

Given a list of paths (i.e. a list of list of trees) return a list of trees such that each tree is annotated with the paths it belongs to.

singletonPolPath :: Int -> PolPathSetSource

A (trivially) packed representation of the singleton set containing a single polarity path

Inner stuff (exported for debugging?)

fixPronouns :: (Sem, [TagElem]) -> (Sem, [TagElem])Source

Returns a modified input semantics and lexical selection in which pronouns are properly accounted for.

prettyPolPaths :: PolPathSet -> TextSource

Render the list of polarity automaton paths as a string

automatonPaths :: (Ord st, Ord ab) => NFA st ab -> [[ab]]Source

Returns all possible paths through an automaton from the start state to any dead-end.

Each path is represented as a list of labels.

We assume that the automaton does not have any loops in it.

finalSt :: NFA st ab -> [st]Source

finalSt returns all the final states of an automaton

data NFA st ab Source

Note: you can define the final state either by setting isFinalSt to Just f where f is some function or by putting them in finalStList