public class CharniakScoredParsesReaderWriter extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
parsesToString(List<ScoredObject<Tree>> parses)
Convert list of scored parse trees to string representing scored parses
(in the charniak parser output format).
|
static void |
printScoredTrees(Iterable<List<ScoredObject<Tree>>> trees,
String filename)
Print scored parse trees in format used by charniak parser
|
static void |
printScoredTrees(PrintWriter pw,
int id,
List<ScoredObject<Tree>> trees)
Print scored parse trees for one sentence in format used by Charniak parser.
|
static Iterable<List<ScoredObject<Tree>>> |
readScoredTrees(String filename)
Reads scored parses from the charniak parser
File format of the scored parses:
|
static Iterable<List<ScoredObject<Tree>>> |
readScoredTrees(String inputDesc,
BufferedReader br)
Reads scored parses from the charniak parser
|
static List<ScoredObject<Tree>> |
stringToParses(String parseStr)
Convert string representing scored parses (in the charniak parser output format)
to list of scored parse trees
|
public static Iterable<List<ScoredObject<Tree>>> readScoredTrees(String filename)
<# of parses>\t<sentenceid>
<score>
<parse>
<score>
<parse>
... filename - - File to read parses frompublic static Iterable<List<ScoredObject<Tree>>> readScoredTrees(String inputDesc, BufferedReader br)
inputDesc - - Description of input used in log messagesbr - - input readerpublic static List<ScoredObject<Tree>> stringToParses(String parseStr)
parseStr - public static String parsesToString(List<ScoredObject<Tree>> parses)
parses - - list of scored parse treespublic static void printScoredTrees(Iterable<List<ScoredObject<Tree>>> trees, String filename)
trees - - trees to outputfilename - - file to output topublic static void printScoredTrees(PrintWriter pw, int id, List<ScoredObject<Tree>> trees)
pw - - printwriterid - - sentence idtrees - - trees to output