System.err.println(usage());
System.exit(-1);
}
Properties options = StringUtils.argsToProperties(args, optionArgDefs());
Language language = PropertiesUtils.get(options, "l", Language.English, Language.class);
final TreebankLangParserParams tlpp = Languages.getLanguageParams(language);
final int maxGoldYield = PropertiesUtils.getInt(options, "y", Integer.MAX_VALUE);
final boolean VERBOSE = PropertiesUtils.getBool(options, "v", false);
final boolean sortByF1 = PropertiesUtils.hasProperty(options, "s");
int worstKTreesToEmit = PropertiesUtils.getInt(options, "s", 0);
PriorityQueue<Triple<Double,Tree,Tree>> queue = sortByF1 ? new PriorityQueue<Triple<Double,Tree,Tree>>(2000, new F1Comparator()) : null;
boolean doCatLevel = PropertiesUtils.getBool(options, "c", false);
String labelRegex = options.getProperty("f", null);
String encoding = options.getProperty("e", "UTF-8");
String[] parsedArgs = options.getProperty("","").split("\\s+");
if (parsedArgs.length != minArgs) {
System.err.println(usage());
System.exit(-1);
}
String goldFile = parsedArgs[0];
String guessFile = parsedArgs[1];
// Command-line has been parsed. Configure the metric for evaluation.
tlpp.setInputEncoding(encoding);
final PrintWriter pwOut = tlpp.pw();
final Treebank guessTreebank = tlpp.diskTreebank();
guessTreebank.loadPath(guessFile);
pwOut.println("GUESS TREEBANK:");
pwOut.println(guessTreebank.textualSummary());
final Treebank goldTreebank = tlpp.diskTreebank();
goldTreebank.loadPath(goldFile);
pwOut.println("GOLD TREEBANK:");
pwOut.println(goldTreebank.textualSummary());
final Evalb metric = new Evalb("Evalb LP/LR", true);
final EvalbByCat evalbCat = (doCatLevel) ? new EvalbByCat("EvalbByCat LP/LR", true, labelRegex) : null;
final TreeTransformer tc = tlpp.collinizer();
//The evalb ref implementation assigns status for each tree pair as follows:
//
// 0 - Ok (yields match)
// 1 - length mismatch