Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Alternative (to NLP.Partage.Tree) representation of TAG trees, in which information about the foot is present in the tree itself.
- type Tree n t = Tree (Node n t)
- data Node n t
- type SomeTree n t = Either (Tree n t) (AuxTree n t)
- encode :: SomeTree n t -> Tree n t
- decode :: Tree n t -> SomeTree n t
- isTerm :: Node n t -> Bool
- isFinal :: Tree n t -> Bool
- isInitial :: Tree n t -> Bool
- isAuxiliary :: Tree n t -> Bool
- hasRoot :: Eq n => n -> Tree n t -> Bool
- project :: Tree n t -> [t]
TAG Tree
type Tree n t = Tree (Node n t) Source
An initial or auxiliary TAG tree. Note that the type doesn't ensure that the foot is placed in a leaf, nor that there is at most one foot node. On the other hand, and in contrast to NLP.Partage.Tree, information about the foot is available at the level of the corresponding foot node.
Node of a TAG tree.
Base representation
type SomeTree n t = Either (Tree n t) (AuxTree n t) Source
An original tree representation (see NLP.Partage.Tree).
Conversion
decode :: Tree n t -> SomeTree n t Source
Decode the tree represented with the alternative representation.
Utils
isFinal :: Tree n t -> Bool Source
Is it a final tree (i.e. does it contain only terminals in its leaves)?
isAuxiliary :: Tree n t -> Bool Source
Is it an auxiliary (i.e. with a foot) tree?