mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-10 05:29:30 -06:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,8 @@ public class Concr {
|
||||
|
||||
public native List<MorphoAnalysis> lookupMorpho(String sentence);
|
||||
|
||||
public native boolean hasLinearization(String id);
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// private stuff
|
||||
|
||||
|
||||
Reference in New Issue
Block a user