Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
IOB encoding method extended to forests.
Example:
>>>
:m Data.Named.IOB Data.Named.Tree Text.Named.Enamex Data.Text.Lazy
>>>
let enamex = pack "<x>w1.1\\ w1.2</x> w2 <y><z>w3</z> w4</y>"
>>>
putStr . drawForest . mapForest show . parseForest $ enamex
Left "x" | `- Right "w1.1 w1.2" , Right "w2" , Left "y" | +- Left "z" | | | `- Right "w3" | `- Right "w4"
>>>
mapM_ print . encodeForest . parseForest $ enamex
IOB {word = "w1.1 w1.2", label = [B "x"]} IOB {word = "w2", label = []} IOB {word = "w3", label = [B "y",B "z"]} IOB {word = "w4", label = [I "y"]}
Documentation
An IOB
data structure consists of a word with a corresponding
compound label.
An Atom
is the atomic label with additional marker.
encodeForest :: NeForest a w -> [IOB w a] Source #
Encode the forest with the IOB method.