Skip to content

LT-22699: New capability for Hermit Crab: per-affix maximum application count - #1263

Draft
johnml1135 wants to merge 1 commit into
mainfrom
feature/LT-22699-hc-affix-maxapps
Draft

johnml1135 wants to merge 1 commit into
mainfrom
feature/LT-22699-hc-affix-maxapps

Conversation

@johnml1135

@johnml1135 johnml1135 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Start here: HCLoader reads a per-affix maximum application count from the project's ParserParameters, so FLEx's Hermit Crab parser can apply one affix more than once. Nothing in FLEx writes the key yet; Motif writes it today.

Need. Hermit Crab supports MaxApplicationCount on affix rules (default 1), and FieldWorks never sets it. Swahili needs repeated verb extensions (-ishana, -ezea, a causative twice) and Tamil needs converbs after an auxiliary.

Storage key.

<HC><AffixRules><AffixRule guid="<MSA guid>" maxApps="2"/></AffixRules></HC>

The guid names the MSA the rule is built from: the representative MSA when MSAs are merged (the default), the MSA itself when HC/MergeMSAs is false. Absent, unparseable or non-positive maxApps keeps 1; values above 10 clamp to 10. Unknown guids are ignored.

Scope. Only HC/AffixRules is new. CompoundRules and its maxApps are untouched.

Review. HCLoader.cs (a dictionary read in the constructor, one lookup in LoadMorphologicalRule) and eight new HCLoaderTests cases: absent key, maxApps=2, invalid values, above-range clamp, guid matching no MSA, merged MSAs, and MergeMSAs=false with two MSAs on one entry where only the keyed, non-representative MSA's rule gets the count.

Testing. Not run locally: the Windows build of this worktree stopped on a missing sil.windows.forms package file (Interop.WIA.dll), unrelated to this change. Comment hygiene passed. CI is the first test run.

Jira: LT-22699 (existing request, "Allow Hermit Crab parser to try affixes more than once"). Related: sillsdev/motif#436, sillsdev/PanGloss#476.

Next: reviewer confirms the cap of 10 and that keying on the representative MSA matches how users will set it.

🤖 Generated with Claude Code


This change is Reviewable

HCLoader now reads HC/AffixRules/AffixRule (guid, maxApps) from the
project's ParserParameters and sets MaxApplicationCount on the affix
rule built from that MSA. The guid is the representative MSA when
MSAs are merged, otherwise the MSA itself.

Absent, unparseable or non-positive values keep the default of one
application. Values above ten are clamped to ten.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

NUnit Tests

    1 files  ± 0      1 suites  ±0   15m 28s ⏱️ +36s
7 431 tests +11  7 352 ✅ +11  79 💤 ±0  0 ❌ ±0 
7 440 runs  +11  7 361 ✅ +11  79 💤 ±0  0 ❌ ±0 

Results for commit 0ead571. ± Comparison against base commit 183be7c.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 40.92%. Comparing base (183be7c) to head (0ead571).

Files with missing lines Patch % Lines
Src/LexText/ParserCore/HCLoader.cs 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1263      +/-   ##
==========================================
- Coverage   40.92%   40.92%   -0.01%     
==========================================
  Files        1602     1602              
  Lines      360800   360811      +11     
  Branches    42245    42248       +3     
==========================================
- Hits       147648   147647       -1     
- Misses     183655   183667      +12     
  Partials    29497    29497              
Files with missing lines Coverage Δ
Src/LexText/ParserCore/HCLoader.cs 74.92% <90.90%> (+0.08%) ⬆️

... and 6 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.

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.

2 participants