Skip to content

Commit

Permalink
Merge pull request #1447 from linas/rm-disjunct-limit
Browse files Browse the repository at this point in the history
Remove the max-number-of-disjuncts test.
  • Loading branch information
linas authored Feb 21, 2023
2 parents 7d88cf4 + d644b6c commit f78377e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
1 change: 0 additions & 1 deletion link-grammar/api-structures.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ struct Parse_Options_s
no longer than this. Default = 16 */
bool all_short; /* If true, there can be no connectors that are exempt */
bool repeatable_rand; /* Reset rand number gen after every parse. */
int disjunct_limit; /* Don't attempt parsing when too many disjuncts */

/* Options governing post-processing */
bool perform_pp_prune; /* Perform post-processing-based pruning TRUE */
Expand Down
10 changes: 0 additions & 10 deletions link-grammar/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,6 @@ Parse_Options parse_options_create(void)
#endif
po->linkage_limit = 100;

// Do not even attempt parsing if the sentance has more than this
// many disjuncts. This is a heuristic; sentences with more than
// this many disjuncts will take more than 60 seconds to parse.
// They'll also chew up tens of gigabytes of RAM during parsing.
// This limit is never encountered in the conventional, hand-written
// dictionaries, but will be hit when working with MST dictionaries.
// The goal is to avoid out-of-control RAM usage.
// Set to -1 to disable.
po->disjunct_limit = 105123;

// Disable spell-guessing by default. Aspell 0.60.8 and possibly
// others leak memory.
po->use_spell_guess = 0;
Expand Down
8 changes: 0 additions & 8 deletions link-grammar/parse/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,14 +705,6 @@ void classic_parse(Sentence sent, Parse_Options opts)
free_count_context(ctxt, sent);
ctxt = alloc_count_context(sent, ts_parsing);

if ((0 < opts->disjunct_limit) &&
((unsigned) opts->disjunct_limit < sent->num_disjuncts))
{
lgdebug(+2, "Sentence disjunct count %u exceeded limit %d\n",
sent->num_disjuncts, opts->disjunct_limit);
sent->num_linkages_found = 0;
goto parse_end_cleanup;
}
sent->num_linkages_found = do_parse(sent, mchxt, ctxt, opts);

print_time(opts, "Counted parses (%d w/%u null%s)",
Expand Down

0 comments on commit f78377e

Please sign in to comment.