diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2012-06-12 11:30:01 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2012-06-12 11:30:01 +0000 |
| commit | c9c5675e1dba3dc371d53c8255743e0eb38488e2 (patch) | |
| tree | 8b0ebaee6197c13cc64048b7f25d176c45091141 /src/runtime/c/pgf/reader.c | |
| parent | 90306fa926bfebec64ffdd61524c67a45330cd46 (diff) | |
now there is a limit of 2000000 items in the chart of the robust parser. This prevents from explosion in the memory size but it will also prevent us from parsing some sentences.
Diffstat (limited to 'src/runtime/c/pgf/reader.c')
| -rw-r--r-- | src/runtime/c/pgf/reader.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/runtime/c/pgf/reader.c b/src/runtime/c/pgf/reader.c index 08cc16096..166dc9bd2 100644 --- a/src/runtime/c/pgf/reader.c +++ b/src/runtime/c/pgf/reader.c @@ -791,6 +791,7 @@ pgf_read_new_PgfConcr(GuType* type, PgfReader* rdr, GuPool* pool, concr->callbacks = pgf_new_callbacks_map(concr, pool); concr->total_cats = pgf_read_int(rdr); concr->max_fid = concr->total_cats; + concr->item_quota = 2000000; // set the function ids int n_funs = gu_list_length(concr->cncfuns); @@ -987,3 +988,13 @@ pgf_load_meta_child_probs(PgfPGF* pgf, const char* fpath, GuPool* pool) fclose(fp); return true; } + +void +pgf_set_item_quota(PgfConcr* concr, int quota) { + concr->item_quota = quota > 0 ? quota : 0; +} + +int +pgf_get_item_quota(PgfConcr* concr) { + return concr->item_quota; +} |
