parse_spmrl_ptb_file

Function parse_spmrl_ptb_file 

Source
pub fn parse_spmrl_ptb_file(
    f: &str,
    singlebracketed: bool,
    remove_after_dash: bool,
) -> Result<Vec<PTBTree>, Box<dyn Error>>
Expand description

Parse a 1-per-line PTB file (SPMRL file format) (single-bracketed possible), removing morph tags on non-terminals and replacing underscores with — in NTs! If remove_after_dash is set to True, it will even remove everything after a dash (this is applied before the underscore-replacing, of course).

Just reads line per line, prepends ‘(’ and appends ‘)’ and calls parse_ptbtrees.