Function ptb_reader::parse_ptbtree [] [src]

pub fn parse_ptbtree(s: &str) -> Option<PTBTree>

Parse a single tree.

Wrapper around parse_ptbtrees, returns None if string contains not exactly one tree.

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