[][src]Trait lumberjack::UnaryChains

pub trait UnaryChains {
    fn collapse_unary_chains(&mut self, delim: &str) -> Result<(), Error>;
fn restore_unary_chains(&mut self, delim: &str) -> Result<(), Error>; }

Required methods

fn collapse_unary_chains(&mut self, delim: &str) -> Result<(), Error>

Collapse unary chains.

Collapses unary chains into the node label of the lowest node in the chain, delimiting each node with delim.

E.g. assuming delim == "_", (S (UC1 (UC2 (T t)))) is collapsed into (UC2_UC1_S_T t).

Collapsing is not lossless, Edge labels and annotations associated with the collapsed nonterminals are lost.

fn restore_unary_chains(&mut self, delim: &str) -> Result<(), Error>

Restore unary chains.

Inverse of collapse_unary_chains. Expands the unary chains collapsed into node labels.

E.g. assuming delim == "_", (UC2_UC1_S_T t) is expanded into (S (UC1 (UC2 (T t)))).

Loading content...

Implementors

impl UnaryChains for Tree[src]

Loading content...