1
0
forked from GitHub/gf-core

added API in the C runtime and the Java binding for checking whether a given function is linearizable in a given language. This is used in the Android UI for better vizualizations

This commit is contained in:
kr.angelov
2013-11-27 12:35:11 +00:00
parent eeec31cbab
commit b0a74ddc59
6 changed files with 31 additions and 28 deletions

View File

@@ -472,6 +472,17 @@ Java_org_grammaticalframework_pgf_Concr_lookupMorpho(JNIEnv* env, jobject self,
return analyses;
}
JNIEXPORT jboolean JNICALL
Java_org_grammaticalframework_pgf_Concr_hasLinearization(JNIEnv* env, jobject self, jstring jid)
{
PgfConcr* concr = get_ref(env, self);
GuPool* tmp_pool = gu_new_pool();
PgfCId id = j2gu_string(env, jid, tmp_pool);
bool res = pgf_has_linearization(concr, id);
gu_pool_free(tmp_pool);
return res;
}
JNIEXPORT void JNICALL
Java_org_grammaticalframework_pgf_Pool_free(JNIEnv* env, jobject self, jlong ref)
{

View File

@@ -25,6 +25,8 @@ public class Concr {
public native List<MorphoAnalysis> lookupMorpho(String sentence);
public native boolean hasLinearization(String id);
//////////////////////////////////////////////////////////////////
// private stuff