Safe Haskell | Safe-Infered |
---|
Lexical entries
As a factorisation technique, LTAG grammars are commonly separated into
tree schemata (see TreeSchema
) and lexical entries. The
grammar is what you get by “anchoring” each lexical entry to the relevant
tree schemata.
- type Lexicon = [LexEntry]
- data LexEntry
- mkLexEntry :: FullList Text -> Text -> [GeniVal] -> Flist GeniVal -> Flist GeniVal -> Flist GeniVal -> Sem -> LexEntry
- mkFullLexEntry :: FullList Text -> Text -> [GeniVal] -> Flist GeniVal -> Flist GeniVal -> Flist GeniVal -> Sem -> [SemPols] -> LexEntry
- iword :: LexEntry -> FullList Text
- ifamname :: LexEntry -> Text
- iparams :: LexEntry -> [GeniVal]
- iinterface :: LexEntry -> Flist GeniVal
- ifilters :: LexEntry -> Flist GeniVal
- iequations :: LexEntry -> Flist GeniVal
- isemantics :: LexEntry -> Sem
- isempols :: LexEntry -> [SemPols]
- type PolValue = (GeniVal, Int)
- fromLexSem :: [Literal PolValue] -> (Sem, [SemPols])
- fromLexLiteral :: Literal PolValue -> (Literal GeniVal, SemPols)
Documentation
data LexEntry
Lexical entry
:: FullList Text | word |
-> Text | family name |
-> [GeniVal] | parameters list (deprecated) |
-> Flist GeniVal | interface (use instead of params) |
-> Flist GeniVal | filters |
-> Flist GeniVal | equations |
-> Sem | semantics |
-> LexEntry |
See also mkFullLexEntry
This version comes with some sensible defaults.
:: FullList Text | word |
-> Text | family name |
-> [GeniVal] | parameters list (deprecated) |
-> Flist GeniVal | interface (use instead of params) |
-> Flist GeniVal | filters |
-> Flist GeniVal | equations |
-> Sem | semantics |
-> [SemPols] | semantic polarities |
-> LexEntry |
Variant of mkLexEntry
but with more control
iinterface :: LexEntry -> Flist GeniVal
features to unify with tree schema interface
iequations :: LexEntry -> Flist GeniVal
path equations
isemantics :: LexEntry -> Sem
lexical semantics
isempols :: LexEntry -> [SemPols]
polarities (must be same length as isemantics
)
Converting between lexical/normal semantics
type PolValue = (GeniVal, Int)
An annotated GeniVal. This is for a rather old, obscure variant on the polarity filtering optimisation. To account for zero literal semantics, we annotate each value in the semantics with a positive/negative marker. These markers are then counted up to determine with we need to insert more literals into the semantics or not. See the manual on polarity filtering for more details
fromLexSem :: [Literal PolValue] -> (Sem, [SemPols])
Separate an input lexical semantics into the actual semantics and the semantic polarity entries (which aren't used very much in practice, being a sort of experimental feature to solve an obscure-ish technical problem)