Skip to content

Support LT-22605: Add ability to limit HermitCrab parses#452

Draft
jtmaxwell3 wants to merge 1 commit into
masterfrom
LT-22605
Draft

Support LT-22605: Add ability to limit HermitCrab parses#452
jtmaxwell3 wants to merge 1 commit into
masterfrom
LT-22605

Conversation

@jtmaxwell3

@jtmaxwell3 jtmaxwell3 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

MaxUnapplications was an experimental variable that never got incorporated into FieldWorks. I decided to rename it MaxAlternatives for clarity and to change it to throw TimeoutException since the MaxUnapplications implementation truncated results without telling the user and since it could produce different results with different parses of the same word because of multi-threading.

MaxAlternatives caps the number of alternatives produced by each stratum during analysis. This is where most of the blowup occurs since rules and templates within a stratum are unordered and since rules and templates are optional during unapplication (analysis). We could also limit the number of lexical entries found after analysis but the number of lexical entries that are found after analysis is usually proportionate to the number of alternatives, so it probably isn't necessary. Furthermore, we could limit the number of alternatives considered within each stratum during synthesis, but the number of alternatives generated is usually proportionate to the number of lexical entries found because rules are obligatory in the synthesis direction and there are rarely alternative orderings of the rules that match. Limiting the alternatives produced by each stratum should be enough to bound the amount of time spent parsing a word.

I tested this against Aweti-opap-no-go from Andy Black by setting MaxAlternatives to 1000 and all of the words finished in a reasonable amount of time and the words that were limited gave a reasonable error message.


This change is Reviewable

@jtmaxwell3 jtmaxwell3 marked this pull request as draft July 7, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant