Skip to content

Fix LT-22605: Add ability to limit Hermit Crab parses - #1071

Open
jtmaxwell3 wants to merge 1 commit into
mainfrom
LT-22605
Open

Fix LT-22605: Add ability to limit Hermit Crab parses#1071
jtmaxwell3 wants to merge 1 commit into
mainfrom
LT-22605

Conversation

@jtmaxwell3

@jtmaxwell3 jtmaxwell3 commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

This fixes https://jira.sil.org/browse/LT-22605. It adds a MaxAlternatives parameter to the Parser Parameters dialog and uses it to set MaxAlternatives in a new version of Hermit Crab.


This change is Reviewable

@AndyBlack AndyBlack left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown

NUnit Tests

    1 files  ±0      1 suites  ±0   9m 22s ⏱️ - 1m 2s
5 774 tests ±0  5 693 ✅ ±0  81 💤 ±0  0 ❌ ±0 
5 783 runs  ±0  5 702 ✅ ±0  81 💤 ±0  0 ❌ ±0 

Results for commit 4fcaa4b. ± Comparison against base commit 99858db.

♻️ This comment has been updated with latest results.

@codecov-commenter

codecov-commenter commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.05%. Comparing base (99858db) to head (4fcaa4b).

Files with missing lines Patch % Lines
Src/LexText/ParserCore/HCParser.cs 0.00% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1071   +/-   ##
=======================================
  Coverage   38.04%   38.05%           
=======================================
  Files        1499     1499           
  Lines      350127   350135    +8     
  Branches    40239    40241    +2     
=======================================
+ Hits       133215   133233   +18     
+ Misses     187625   187615   -10     
  Partials    29287    29287           
Files with missing lines Coverage Δ
Src/LexText/ParserCore/HCParser.cs 0.20% <0.00%> (-0.01%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@thejambi

Copy link
Copy Markdown
Contributor

Src/LexText/ParserCore/HCParser.cs line 175 at r1 (raw file):

				if (maxRootsElem != null)
					maxStemCount = int.Parse(maxRootsElem.Value);
				if (maxRootsElem != null)

Is this if intended to check maxRootsElem again like the check just before it? Should it be checking maxAlternativesElem instead?

@jtmaxwell3

Copy link
Copy Markdown
Collaborator Author

@thejambi: Good catch! Thanks!

@thejambi

Copy link
Copy Markdown
Contributor

Src/LexText/ParserUI/ParserParametersDlg.cs line 46 at r1 (raw file):

		private const string MaxInterfixes = "MaxInterfixes";
		private const string MaxRoots = "MaxRoots";
		private const string MaxAlternatives = "MaxAlternatives";

Should we add a EnforceValidValue call for MaxAlternatives in the ValidateValues method? It looks like 0 would be the minimum, but I am not sure what we would want to cap the maximum value for this at.

@thejambi thejambi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thejambi reviewed 4 files and all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on jtmaxwell3).

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.

4 participants