Enum ptb_reader::PTBTree [] [src]

pub enum PTBTree {
    InnerNode {
        label: String,
        children: Vec<PTBTree>,
    },
    TerminalNode {
        label: String,
    },
}

Arbitrarily wide recursive trees of String.

Variants

Fields of InnerNode

Fields of TerminalNode

Methods

impl PTBTree
[src]

Return bracketed (and outside-bracketed!) PTB notation:

use ptb_reader::PTBTree;
let tree = PTBTree::InnerNode{ label: "NT".to_string(), children: vec![PTBTree::TerminalNode{ label: "t".to_string() }] };
assert_eq!(tree.render(), "((NT t))")

Return String from joined terminals at the leaves (i.e, front, yield).

use ptb_reader::PTBTree;
let tree = PTBTree::InnerNode{ label: "NT".to_string(), children: vec![PTBTree::TerminalNode{ label: "t".to_string() }] };
assert_eq!(tree.front(), "t")

Return String from joined pre-terminals (i.e., POS tags).

use ptb_reader::PTBTree;
let tree = PTBTree::InnerNode{ label: "NT".to_string(), children: vec![PTBTree::TerminalNode{ label: "t".to_string() }] };
assert_eq!(tree.pos_front(), "NT")

Return number of terminal words, i.e. length of front.

Remove predicate-argument annotations and trace elements. See . Thanks to Toni Dietze for formalizing the necessary stripping :)

Trait Implementations

impl Debug for PTBTree
[src]

Formats the value using the given formatter.

impl Clone for PTBTree
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for PTBTree
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for PTBTree
[src]

impl Display for PTBTree
[src]

Calls self.render().