mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
added graphvizAbstractTree and graphvizParseTree in Java
This commit is contained in:
@@ -1081,7 +1081,7 @@ n0 -- n3 [style = "solid"]
|
|||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="java">
|
<pre class="java">
|
||||||
System.out.println(gr.graphvizAbstractTree(e)); //// TODO
|
System.out.println(gr.graphvizAbstractTree(e));
|
||||||
graph {
|
graph {
|
||||||
n0[label = "AdjCN", style = "solid", shape = "plaintext"]
|
n0[label = "AdjCN", style = "solid", shape = "plaintext"]
|
||||||
n1[label = "PositA", style = "solid", shape = "plaintext"]
|
n1[label = "PositA", style = "solid", shape = "plaintext"]
|
||||||
@@ -1184,7 +1184,7 @@ graph {
|
|||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
<pre class="java">
|
<pre class="java">
|
||||||
System.out.println(eng.graphvizParseTree(e)); //// TODO
|
System.out.println(eng.graphvizParseTree(e));
|
||||||
graph {
|
graph {
|
||||||
node[shape=plaintext]
|
node[shape=plaintext]
|
||||||
|
|
||||||
|
|||||||
@@ -371,6 +371,25 @@ Java_org_grammaticalframework_pgf_PGF_getFunctionsByCat(JNIEnv* env, jobject sel
|
|||||||
return functions;
|
return functions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT jstring JNICALL
|
||||||
|
Java_org_grammaticalframework_pgf_PGF_graphvizAbstractTree(JNIEnv* env, jobject self, jobject jexpr)
|
||||||
|
{
|
||||||
|
GuPool* tmp_pool = gu_local_pool();
|
||||||
|
|
||||||
|
GuExn* err = gu_exn(tmp_pool);
|
||||||
|
GuStringBuf* sbuf = gu_new_string_buf(tmp_pool);
|
||||||
|
GuOut* out = gu_string_buf_out(sbuf);
|
||||||
|
|
||||||
|
pgf_graphviz_abstract_tree(get_ref(env,self),
|
||||||
|
gu_variant_from_ptr(l2p(get_ref(env,jexpr))),
|
||||||
|
out, err);
|
||||||
|
|
||||||
|
jstring jstr = gu2j_string_buf(env, sbuf);
|
||||||
|
|
||||||
|
gu_pool_free(tmp_pool);
|
||||||
|
return jstr;
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT jstring JNICALL
|
JNIEXPORT jstring JNICALL
|
||||||
Java_org_grammaticalframework_pgf_Concr_getName(JNIEnv* env, jobject self)
|
Java_org_grammaticalframework_pgf_Concr_getName(JNIEnv* env, jobject self)
|
||||||
{
|
{
|
||||||
@@ -1198,6 +1217,25 @@ Java_org_grammaticalframework_pgf_Concr_getPrintName(JNIEnv* env, jobject self,
|
|||||||
return jname;
|
return jname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT jstring JNICALL
|
||||||
|
Java_org_grammaticalframework_pgf_Concr_graphvizParseTree(JNIEnv* env, jobject self, jobject jexpr)
|
||||||
|
{
|
||||||
|
GuPool* tmp_pool = gu_local_pool();
|
||||||
|
|
||||||
|
GuExn* err = gu_exn(tmp_pool);
|
||||||
|
GuStringBuf* sbuf = gu_new_string_buf(tmp_pool);
|
||||||
|
GuOut* out = gu_string_buf_out(sbuf);
|
||||||
|
|
||||||
|
pgf_graphviz_parse_tree(get_ref(env,self),
|
||||||
|
gu_variant_from_ptr(l2p(get_ref(env,jexpr))),
|
||||||
|
out, err);
|
||||||
|
|
||||||
|
jstring jstr = gu2j_string_buf(env, sbuf);
|
||||||
|
|
||||||
|
gu_pool_free(tmp_pool);
|
||||||
|
return jstr;
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL
|
JNIEXPORT jlong JNICALL
|
||||||
Java_org_grammaticalframework_pgf_Pool_alloc(JNIEnv* env, jclass clazz)
|
Java_org_grammaticalframework_pgf_Pool_alloc(JNIEnv* env, jclass clazz)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user