mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
fix in the Python binding. The input sentence to the parser needs to be copied since otherwise the Python string may be discarded the garbage collector
This commit is contained in:
@@ -1429,6 +1429,9 @@ Concr_parse(ConcrObject* self, PyObject *args, PyObject *keywds)
|
||||
pypgf_new_callbacks_map(self->concr, py_callbacks, pyres->pool);
|
||||
if (callbacks == NULL)
|
||||
return NULL;
|
||||
|
||||
sentence = gu_string_copy(sentence, pyres->pool);
|
||||
|
||||
pyres->res =
|
||||
pgf_parse_with_heuristics(self->concr, catname, sentence,
|
||||
heuristics, callbacks, parse_err,
|
||||
|
||||
Reference in New Issue
Block a user