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