mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
added method for best first parsing in the Java binding
This commit is contained in:
@@ -9,7 +9,16 @@ public class Concr {
|
|||||||
public Iterable<ExprProb> parse(String startCat, String s) {
|
public Iterable<ExprProb> parse(String startCat, String s) {
|
||||||
return new Parser(this, startCat, 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);
|
public native String linearize(Expr expr);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user