1
0
forked from GitHub/gf-core

added preliminary API for custom literals from Java. Not functional yet

This commit is contained in:
kr.angelov
2014-04-08 13:54:49 +00:00
parent f99d3033aa
commit a90756aeda
4 changed files with 30 additions and 0 deletions

View File

@@ -38,6 +38,8 @@ public class Concr {
public native void unload();
public native void addLiteral(String cat, LiteralCallback callback);
//////////////////////////////////////////////////////////////////
// private stuff

View File

@@ -0,0 +1,16 @@
package org.grammaticalframework.pgf;
public class ExprBuilder {
public ExprBuilder() {
}
ExprBuilder(long poolRef) {
}
public native Expr mkApp(String fun, Expr... args);
public native Expr mkLiteral(String s);
public native Expr mkLiteral(int n);
public native Expr mkLiteral(double d);
}

View File

@@ -0,0 +1,5 @@
package org.grammaticalframework.pgf;
public interface LiteralCallback {
public int match(Concr concr, int lin_idx, ExprBuilder builder, String sentence, int start_offset);
}

View File

@@ -0,0 +1,7 @@
package org.grammaticalframework.pgf;
public class NercLiteralCallback implements LiteralCallback {
public int match(Concr concr, int lin_idx, ExprBuilder builder, String sentence, int start_offset) {
return start_offset;
}
}