summaryrefslogtreecommitdiff
path: root/src/runtime/python/pypgf.c
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2013-08-16 12:44:37 +0000
committerkr.angelov <kr.angelov@gmail.com>2013-08-16 12:44:37 +0000
commit1e44fdb3d3413709ae635f0fae91ffa4a93a2d9d (patch)
tree525687c815be70d86c7be23e61ba708746bbf725 /src/runtime/python/pypgf.c
parentfc7e77bf50adaceeec2364fa88134b533f0da00f (diff)
fixes in the C and Python API to make them closer to the Haskell API
Diffstat (limited to 'src/runtime/python/pypgf.c')
-rw-r--r--src/runtime/python/pypgf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c
index e2fc0234e..d54dd14ad 100644
--- a/src/runtime/python/pypgf.c
+++ b/src/runtime/python/pypgf.c
@@ -1228,7 +1228,7 @@ Concr_parse(ConcrObject* self, PyObject *args, PyObject *keywds)
}
static IterObject*
-Concr_getCompletions(ConcrObject* self, PyObject *args, PyObject *keywds)
+Concr_complete(ConcrObject* self, PyObject *args, PyObject *keywds)
{
static char *kwlist[] = {"sentence", "tokens", "cat",
"prefix", "n", NULL};
@@ -1295,7 +1295,7 @@ Concr_getCompletions(ConcrObject* self, PyObject *args, PyObject *keywds)
}
pyres->res =
- pgf_get_completions(self->concr, catname, lexer, prefix, pyres->pool);
+ pgf_complete(self->concr, catname, lexer, prefix, pyres->pool);
if (pyres->res == NULL) {
Py_DECREF(pyres);
@@ -1698,7 +1698,7 @@ static PyMethodDef Concr_methods[] = {
"- n (int), max. trees; OPTIONAL, default: extract all trees\n"
"- heuristics (double >= 0.0); OPTIONAL, default: taken from the flags in the grammar"
},
- {"getCompletions", (PyCFunction)Concr_getCompletions, METH_VARARGS | METH_KEYWORDS,
+ {"complete", (PyCFunction)Concr_complete, METH_VARARGS | METH_KEYWORDS,
"Parses a partial string and returns a list with the top n possible next tokens"
},
{"parseval", (PyCFunction)Concr_parseval, METH_VARARGS,
@@ -2011,7 +2011,7 @@ PGF_functionType(PGFObject* self, PyObject *args)
}
static IterObject*
-PGF_generate(PGFObject* self, PyObject *args, PyObject *keywds)
+PGF_generateAll(PGFObject* self, PyObject *args, PyObject *keywds)
{
static char *kwlist[] = {"cat", "n", NULL};
@@ -2040,7 +2040,7 @@ PGF_generate(PGFObject* self, PyObject *args, PyObject *keywds)
GuString catname = gu_str_string(catname_s, tmp_pool);
pyres->res =
- pgf_generate(self->pgf, catname, pyres->pool);
+ pgf_generate_all(self->pgf, catname, pyres->pool);
if (pyres->res == NULL) {
Py_DECREF(pyres);
gu_pool_free(tmp_pool);
@@ -2122,7 +2122,7 @@ static PyMethodDef PGF_methods[] = {
{"functionType", (PyCFunction)PGF_functionType, METH_VARARGS,
"Returns the type of a function"
},
- {"generate", (PyCFunction)PGF_generate, METH_VARARGS | METH_KEYWORDS,
+ {"generateAll", (PyCFunction)PGF_generateAll, METH_VARARGS | METH_KEYWORDS,
"Generates abstract syntax trees of given category in decreasing probability order"
},
{"compute", (PyCFunction)PGF_compute, METH_VARARGS,