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

Safe HaskellSafe-Infered

NLP.GenI.Polarity.Internal

Synopsis

Documentation

detectRootCompensation :: Set PolarityAttr -> FeatStruct GeniVal -> PolMap

Given a description of what the root feature should unify with return a -1 polarity for all relevant polarity keys. This allows us to compensate for the root node of any derived tree.

detectPolarity

Arguments

:: Int

polarity to assign

-> PolarityAttr

attribute to look for

-> FeatStruct GeniVal

feature structure to filter on (RestrictedPolarityAttr only)

-> FeatStruct GeniVal

feature structure to get value from

-> PolarityDetectionResult 

convertUnconstrainedPolarities :: [PolarityKey] -> PolMap -> PolMap

Convert any unconstrained polarities in a PolMap to constrained ones, assuming a global list of known constrained keys.

nubAut :: (Ord ab, Ord st) => NFA st ab -> NFA st ab

Ensures that all states and transitions in the polarity automaton are unique. This is a slight optimisation so that we don't have to repeatedly check the automaton for state uniqueness during its construction, but it is essential that this check be done after construction

pdResults :: [PolarityDetectionResult] -> [(PolarityKey, Interval)]

Note that this will crash if any of the entries are errors

pdToList

Arguments

:: (String -> String)

on error message

-> PolarityDetectionResult 
-> [(PolarityKey, Interval)] 

Note that this will crash if any of the entries are errors