mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
Added showPrintName to py-bindings.
This commit is contained in:
@@ -186,6 +186,20 @@ abstractName(PGFModule* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static PyObject*
|
||||||
|
printName(PGFModule *self, PyObject *args)
|
||||||
|
{
|
||||||
|
Lang* lang;
|
||||||
|
CId* id;
|
||||||
|
if (!PyArg_ParseTuple(args, "OO", &lang, &id))
|
||||||
|
return NULL;
|
||||||
|
char *pname = gf_showPrintName(self->obj, lang->obj, id->obj);
|
||||||
|
PyObject* result = PyString_FromString(pname);
|
||||||
|
free(pname);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
parse(PyObject *self, PyObject *args, PyObject *kws)
|
parse(PyObject *self, PyObject *args, PyObject *kws)
|
||||||
{
|
{
|
||||||
@@ -244,6 +258,7 @@ static PyMethodDef pgf_methods[] = {
|
|||||||
{"parse", (PyCFunction)parse, METH_VARARGS|METH_KEYWORDS,"Parse a string."},
|
{"parse", (PyCFunction)parse, METH_VARARGS|METH_KEYWORDS,"Parse a string."},
|
||||||
{"lin", (PyCFunction)linearize, METH_VARARGS,"Linearize tree."},
|
{"lin", (PyCFunction)linearize, METH_VARARGS,"Linearize tree."},
|
||||||
{"lang_code", (PyCFunction)languageCode, METH_VARARGS,"Get the language code."},
|
{"lang_code", (PyCFunction)languageCode, METH_VARARGS,"Get the language code."},
|
||||||
|
{"print_name", (PyCFunction)printName, METH_VARARGS,"Get the print name for a id."},
|
||||||
{"startcat", (PyCFunction)startCategory, METH_NOARGS,"Get the start category."},
|
{"startcat", (PyCFunction)startCategory, METH_NOARGS,"Get the start category."},
|
||||||
{"categories", (PyCFunction)categories, METH_NOARGS,"Get all categories."},
|
{"categories", (PyCFunction)categories, METH_NOARGS,"Get all categories."},
|
||||||
{"abstract", (PyCFunction)abstractName, METH_NOARGS,"Get the module abstract name."},
|
{"abstract", (PyCFunction)abstractName, METH_NOARGS,"Get the module abstract name."},
|
||||||
|
|||||||
Reference in New Issue
Block a user