Repository navigation
HermitCrab: analysis metathesis keeps the middle context so it undoes synthesis - #620
johnml1135 wants to merge 6 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #620 +/- ##
==========================================
+ Coverage 75.53% 75.59% +0.06%
==========================================
Files 455 455
Lines 38933 38955 +22
Branches 5428 5436 +8
==========================================
+ Hits 29407 29449 +42
+ Misses 8376 8360 -16
+ Partials 1150 1146 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…ch groups so it undoes synthesis Fixes #619. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Remove boundaries recursively from middle context because analysis filters them out, and accept untyped constraints.
…nvironment still matches the surface DeepCloneExceptBoundaries is shared by metathesis and rewrite-rule analysis, so the boundary-only alternative change reaches rewrite environments too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tive as an empty group Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…udget Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
77efe56 to
47a83b6
Compare
| morpher.GenerateWords(entry, System.Array.Empty<Morpheme>(), new FeatureStruct()), | ||
| Is.EquivalentTo(new[] { "kita" }) | ||
| ); | ||
| AssertMorphsEqual(morpher.ParseWord("kita"), "root", "tika"); |
There was a problem hiding this comment.
Minor: F6. This test fails when run alone: it expects gloss tika, but its only entry is root. tika comes from entries the MiddleSegment/MiddleNaturalClass tests leave in the shared Morphophonemic stratum, which TestCleanup does not clear. dotnet test --filter UntypedMiddleConstraint_AnalysisUndoesSynthesis: 4 failed, "Expected: equivalent to < root, tika > But was: < root >". Expect only root.
| PatternNode<Word, ShapeNode>[] nodes = pattern.Children.ToArray(); | ||
| int firstGroupIndex = Array.FindIndex(nodes, n => n is Group<Word, ShapeNode>); | ||
| int lastGroupIndex = Array.FindLastIndex(nodes, n => n is Group<Word, ShapeNode>); | ||
| for (int i = firstGroupIndex; i <= lastGroupIndex; i++) |
There was a problem hiding this comment.
FYI: F7. A misspelled LeftSwitchName or RightSwitchName no longer fails when the Morpher is built. The old groups[name] threw KeyNotFoundException. This loop just treats an unmatched group as an ordinary one, so the error only shows up at parse time. A pattern with no groups now throws IndexOutOfRangeException on nodes[-1]. Checking both names against groups first would keep the early error. Unverified: read, not run.
|
Approve with fixes. 47a83b6 fixes F5: the PR text now names the rewrite-rule effect, and a rewrite-rule test pins it at both parallelism settings.
Public API, target framework, package, machine.py parity: None verified. F1 addressed. F2 addressed. F3 addressed. F4 addressed. F5 addressed. F6 new. F7 new, unverified. Reviewed at 47a83b6 |
HermitCrab metathesis analysis now exactly undoes synthesis when something sits between the two switch groups. The analysis spec used to drop the nodes between the groups while synthesis leaves them in place. So a rule
t i k -> k i tproducedkitafromtika, but parsingkitanever recoveredtika.Tests cover a middle segment (inside and outside a group) and a middle natural class. They failed before the fix. HermitCrab.Tests: 179 passed.
./local_check.sh --agent-strictis clean.Fixes #619
🤖 Generated with Claude Code
This change is
Also affects rewrite rules: DeepCloneExceptBoundaries is shared with rewrite-subrule environments, CopyFromInput and ModifyFromInput; a boundary-only alternative now stays as an empty group there too. Pinned by RewriteRuleTests.BoundaryOnlyAlternativeInEnvironment_AnalysisUndoesSynthesis.