mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-17 23:22:51 -06:00
added getFunctionProb in the Java and C API
This commit is contained in:
@@ -178,6 +178,18 @@ Java_org_grammaticalframework_pgf_PGF_getFunctionType(JNIEnv* env, jobject self,
|
||||
return jtype;
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_org_grammaticalframework_pgf_PGF_getFunctionProb(JNIEnv* env, jobject self, jstring jid)
|
||||
{
|
||||
PgfPGF* pgf = get_ref(env, self);
|
||||
GuPool* tmp_pool = gu_local_pool();
|
||||
PgfCId id = j2gu_string(env, jid, tmp_pool);
|
||||
double prob = pgf_function_prob(pgf, id);
|
||||
gu_pool_free(tmp_pool);
|
||||
|
||||
return prob;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
GuMapItor fn;
|
||||
JNIEnv *env;
|
||||
|
||||
Reference in New Issue
Block a user