Safe Haskell | Safe-Inferred |
---|
Working with NE trees and forests.
- addWords :: Ord k => Forest k -> [k] -> Forest k
- data Span = Span {}
- leafSpan :: Int -> Span
- (<>) :: Span -> Span -> Span
- spanSet :: Span -> IntSet
- span :: Tree (a, Span) -> Span
- spanTree :: (k -> Int) -> Tree k -> Tree (k, Span)
- spanForest :: (k -> Int) -> Forest k -> Forest (k, Span)
- unSpanTree :: Tree (k, Span) -> Tree k
- unSpanForest :: Forest (k, Span) -> Forest k
- sortTree :: Tree (k, Span) -> Tree (k, Span)
- sortForest :: Forest (k, Span) -> Forest (k, Span)
- mapTrees :: (a -> b) -> Forest a -> Forest b
Combine with words
addWords :: Ord k => Forest k -> [k] -> Forest kSource
Combine the disjoint forest with the list of words. Discontinuities will be patched with no trace.
Span
Trees with span
spanTree :: (k -> Int) -> Tree k -> Tree (k, Span)Source
Annotate tree nodes with spanning info given the function which assignes indices to leaf nodes.
spanForest :: (k -> Int) -> Forest k -> Forest (k, Span)Source
Annotate forest nodes with spanning info.
unSpanTree :: Tree (k, Span) -> Tree kSource
Remove span annotations from the tree.
unSpanForest :: Forest (k, Span) -> Forest kSource
Remove span annotations from the forest.
sortForest :: Forest (k, Span) -> Forest (k, Span)Source
Sort the forest with respect to spanning info.