1
0
forked from GitHub/gf-core

the statistical parser is now using two memory pools: one for parsing and one for the output trees. This means that the memory for parsing can be released as soon as the needed abstract trees are retrieved, while the trees themselves are retained in the separate output pool

This commit is contained in:
kr.angelov
2013-05-06 15:28:04 +00:00
parent 520c2fb59d
commit 7ba27229b3
8 changed files with 60 additions and 35 deletions

View File

@@ -207,7 +207,8 @@ pgf_linearize(PgfConcr* concr, PgfExpr expr, GuWriter* wtr, GuExn* err)
}
GuEnum*
pgf_parse(PgfConcr* concr, PgfCId cat, PgfLexer *lexer, GuPool* pool)
pgf_parse(PgfConcr* concr, PgfCId cat, PgfLexer *lexer,
GuPool* pool, GuPool* out_pool)
{
// Begin parsing a sentence of the specified category
PgfParseState* state =
@@ -233,7 +234,7 @@ pgf_parse(PgfConcr* concr, PgfCId cat, PgfLexer *lexer, GuPool* pool)
return NULL;
// Now begin enumerating the resulting syntax trees
return pgf_parse_result(state, pool);
return pgf_parse_result(state, out_pool);
}
GuEnum*