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

Safe HaskellNone
LanguageHaskell2010

NLP.GenI.Lexicon

Contents

Description

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.

Synopsis

Documentation

type Lexicon = [LexEntry] Source #

Collection of lexical entries

data LexEntry Source #

Lexical entry

Instances

Eq LexEntry Source # 
Data LexEntry Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LexEntry -> c LexEntry #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LexEntry #

toConstr :: LexEntry -> Constr #

dataTypeOf :: LexEntry -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c LexEntry) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LexEntry) #

gmapT :: (forall b. Data b => b -> b) -> LexEntry -> LexEntry #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LexEntry -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LexEntry -> r #

gmapQ :: (forall d. Data d => d -> u) -> LexEntry -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LexEntry -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LexEntry -> m LexEntry #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LexEntry -> m LexEntry #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LexEntry -> m LexEntry #

Binary LexEntry Source # 

Methods

put :: LexEntry -> Put #

get :: Get LexEntry #

putList :: [LexEntry] -> Put #

NFData LexEntry Source # 

Methods

rnf :: LexEntry -> () #

Pretty LexEntry Source # 
GeniShow LexEntry Source # 
DescendGeniVal LexEntry Source # 
Collectable LexEntry Source # 
Loadable Lexicon Source # 
GeniShow [LexEntry] Source # 

mkLexEntry Source #

Arguments

:: 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.

mkFullLexEntry Source #

Arguments

:: 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

iword :: LexEntry -> FullList Text Source #

normally just a singleton, useful for merging synonyms

ifamname :: LexEntry -> Text Source #

tree family to anchor to

iparams :: LexEntry -> [GeniVal] Source #

parameters (deprecrated; use the interface)

iinterface :: LexEntry -> Flist GeniVal Source #

features to unify with tree schema interface

ifilters :: LexEntry -> Flist GeniVal Source #

features to pick out family members we want

iequations :: LexEntry -> Flist GeniVal Source #

path equations

isemantics :: LexEntry -> Sem Source #

lexical semantics

isempols :: LexEntry -> [SemPols] Source #

polarities (must be same length as isemantics)

Converting between lexical/normal semantics

type PolValue = (GeniVal, Int) Source #

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]) Source #

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)

fromLexLiteral :: Literal PolValue -> (Literal GeniVal, SemPols) Source #

Note that by convention we ignore the polarity associated with the predicate itself