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

Safe HaskellSafe-Infered

NLP.GenI.FeatureStructure

Synopsis

Documentation

type Flist a = [AvPair a]Source

sortFlist :: Flist a -> Flist aSource

Sort an Flist according with its attributes

unifyFeat :: Monad m => Flist GeniVal -> Flist GeniVal -> m (Flist GeniVal, Subst)Source

unifyFeat performs feature structure unification, under the these assumptions about the input:

  • Features are ordered
  • The Flists do not share variables (renaming has already been done.

The features are allowed to have different sets of attributes, beacuse we use alignFeat to realign them.

alignFeat :: Flist GeniVal -> Flist GeniVal -> [(Text, GeniVal, GeniVal)]Source

alignFeat is a pre-procesing step used to ensure that feature structures have the same set of keys. If a key is missing in one, we copy it to the other with an anonymous value.

The two feature structures must be sorted for this to work