Safe Haskell | Safe-Infered |
---|
- data PolarityDetectionResult
- = PD_UserError String
- | PD_Nothing
- | PD_Just [(PolarityKey, Interval)]
- | PD_Unconstrained (Text, Interval)
- detectRootCompensation :: Set PolarityAttr -> FeatStruct GeniVal -> PolMap
- detectPolsH :: Set PolarityAttr -> TagElem -> [(PolarityKey, Interval)]
- detectPolarity :: Int -> PolarityAttr -> FeatStruct GeniVal -> FeatStruct GeniVal -> PolarityDetectionResult
- toZero :: Int -> Interval
- substNodes :: TagElem -> [GNode GeniVal]
- substTops :: TagElem -> [Flist GeniVal]
- type SemMap = Map (Literal GeniVal) [TagElem]
- type PolMap = Map PolarityKey Interval
- polarityKeys :: [TagElem] -> PolMap -> [PolarityKey]
- convertUnconstrainedPolarities :: [PolarityKey] -> PolMap -> PolMap
- addPols :: [(PolarityKey, Interval)] -> PolMap -> PolMap
- nubAut :: (Ord ab, Ord st) => NFA st ab -> NFA st ab
- __cat__, __idx__ :: Text
- pdResults :: [PolarityDetectionResult] -> [(PolarityKey, Interval)]
- pdToList :: (String -> String) -> PolarityDetectionResult -> [(PolarityKey, Interval)]
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.
detectPolsH :: Set PolarityAttr -> TagElem -> [(PolarityKey, Interval)]
:: Int | polarity to assign |
-> PolarityAttr | attribute to look for |
-> FeatStruct GeniVal | feature structure to filter on ( |
-> FeatStruct GeniVal | feature structure to get value from |
-> PolarityDetectionResult |
substNodes :: TagElem -> [GNode GeniVal]
type PolMap = Map PolarityKey Interval
polarityKeys :: [TagElem] -> PolMap -> [PolarityKey]
convertUnconstrainedPolarities :: [PolarityKey] -> PolMap -> PolMap
Convert any unconstrained polarities in a PolMap
to constrained
ones, assuming a global list of known constrained keys.
addPols :: [(PolarityKey, Interval)] -> PolMap -> PolMap
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
:: (String -> String) | on error message |
-> PolarityDetectionResult | |
-> [(PolarityKey, Interval)] |
Note that this will crash if any of the entries are errors