added method for best first parsing in the Java binding

This commit is contained in:
kr.angelov
2013-08-27 22:54:10 +00:00
parent e3c5882721
commit 3494107994

View File

@@ -9,7 +9,16 @@ public class Concr {
public Iterable<ExprProb> parse(String startCat, String s) {
return new Parser(this, startCat, s);
}
public Expr parseBest(String startCat, String s) {
Iterator<ExprProb> iter = Parser.parse(this, startCat, s);
if (iter.hasNext()) {
return iter.next().getExpr();
} else {
return null;
}
}
public native String linearize(Expr expr);
//////////////////////////////////////////////////////////////////