Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides basic datatypes specific to Tree Adjoining Grammar tree schemata.
- type Macros = [SchemaTree]
- type SchemaTree = Ttree (GNode SchemaVal)
- data Ttree a = TT {}
- data Ptype
- root :: Tree a -> a
- rootUpd :: Tree a -> a -> Tree a
- foot :: Tree (GNode a) -> GNode a
- setLexeme :: [Text] -> Tree (GNode a) -> Tree (GNode a)
- setAnchor :: FullList Text -> Tree (GNode a) -> Tree (GNode a)
- lexemeAttributes :: [Text]
- crushTreeGNode :: Tree (GNode SchemaVal) -> Maybe (Tree (GNode GeniVal))
- data AdjunctionConstraint
- isAdjConstrained :: GNode gv -> Bool
- addInferredAdjConstraint :: GNode gv -> GNode gv
- data GNode gv = GN {}
- gnnameIs :: NodeName -> GNode gv -> Bool
- type NodeName = Text
- data GType
- gCategory :: Flist GeniVal -> Maybe GeniVal
- showLexeme :: [Text] -> Text
- data SchemaVal
- crushGNode :: GNode SchemaVal -> Maybe (GNode GeniVal)
Documentation
type Macros = [SchemaTree] Source #
Loadable Macros Source # | |
Eq a => Eq (Ttree a) Source # | |
Data a => Data (Ttree a) Source # | |
Binary a => Binary (Ttree a) Source # | |
GeniShow a => GeniShow [Ttree a] Source # | |
GeniShow a => GeniShow (Ttree a) Source # | |
DescendGeniVal v => DescendGeniVal (Ttree v) Source # | |
Collectable a => Collectable (Ttree a) Source # | |
setLexeme :: [Text] -> Tree (GNode a) -> Tree (GNode a) Source #
Given a lexical item l
and a tree node n
(actually a subtree
with no children), return the same node with the lexical item as
its unique child. The idea is that it converts terminal lexeme nodes
into preterminal nodes where the actual terminal is the given lexical
item
setAnchor :: FullList Text -> Tree (GNode a) -> Tree (GNode a) Source #
Given a lexical item s
and a Tree GNode t, returns the tree t'
where l has been assigned to the anchor node in t'
lexemeAttributes :: [Text] Source #
Attributes recognised as lexemes, in order of preference
data AdjunctionConstraint Source #
Essentially boolean representation of adjunction constraint
MaybeAdj | |
ExplicitNoAdj | hard-coded null-adjunction constraint |
InferredNoAdj | inferred by GenI to be adjunction free (ie. during realisation) |
isAdjConstrained :: GNode gv -> Bool Source #
addInferredAdjConstraint :: GNode gv -> GNode gv Source #
Add an inferred adjunction constraint marker unless we already see an explicit one
A single node of a TAG tree.
GN | |
|
Loadable Macros Source # | |
Eq gv => Eq (GNode gv) Source # | |
Data gv => Data (GNode gv) Source # | |
Binary gv => Binary (GNode gv) Source # | |
NFData gv => NFData (GNode gv) Source # | A single node of a TAG tree. |
Pretty (GNode GeniVal) Source # | The default show for GNode tries to be very compact; it only shows the value for cat attribute and any flags which are marked on that node. This is one the places where the pretty representation of a GenI object is different from its GenI-format one |
GeniShow gv => GeniShow (GNode gv) Source # | |
DescendGeniVal v => DescendGeniVal (GNode v) Source # | |
Collectable gv => Collectable (GNode gv) Source # | |
gCategory :: Flist GeniVal -> Maybe GeniVal Source #
Return the value of the "cat" attribute, if available
showLexeme :: [Text] -> Text Source #
Fancy disjunction
A schema value is a disjunction of GenI values. It allows us to express
“fancy” disjunctions in tree schemata, ie. disjunctions over variables
and not just atoms (?X;?Y
).
Our rule is that that when a tree schema is instantiated, any fancy
disjunctions must be “crushed” into a single GeniVal
lest it be
rejected (see crushOne
)
Note that this is still not recursive; we don't have disjunction over
schema values, nor can schema values refer to schema values. It just
allows us to express the idea that in tree schemata, you can have
either variable ?X
or ?Y
.
Orphan instances
Collectable a => Collectable (Tree a) Source # | |
DescendGeniVal a => DescendGeniVal (Map k a) Source # | |