Function ptb_reader::parse_ptbtrees [] [src]

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

Parse a string of multiple trees.

Returns None if string contains anything unparseable.

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