HermitCrab: analysis metathesis drops the middle context that synthesis keeps

Aperta
#619 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@johnml1135 ci sta già lavorando.

Dal 6/11/2026.

  • #620 di @johnml1135 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend, testing

Direzione di ricerca

Read the constructor in src/SIL.Machine.Morphology.HermitCrab/PhonologicalRules/AnalysisMetathesisRuleSpec.cs alongside SynthesisMetathesisRuleSpec.ApplyRhs to understand how the middle context is handled. Keep that context in the analysis pattern and add the metathesis-middle-context fixture to the conformance suite; done means parsing kita finds root tika and the conformance case passes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

AnalysisMetathesisRuleSpec drops the segments between the two switch groups, but SynthesisMetathesisRuleSpec keeps them, so hc.dll never un-applies a metathesis rule with a middle context. For a rule t i k -> k i t, root tika synthesizes to kita, yet parsing kita returns only the analysis of root kita and never tika.

Where: the constructor of src/SIL.Machine.Morphology.HermitCrab/PhonologicalRules/AnalysisMetathesisRuleSpec.cs rebuilds the pattern from the nodes before the first Group, the two switch groups, and the nodes after the last Group (TakeWhile(n => !(n is Group)) from each end). Every node between the groups is lost. SynthesisMetathesisRuleSpec.ApplyRhs (MoveNodesAfter) leaves the middle node in its slot.

Reachable from FieldWorks: a rule's StrucChange can hold a context between the switches.

Repro: fixture conformance-staging/edge-cases/metathesis-middle-context in sillsdev/pangloss (#162). On machine 4d9b454d, kita gives KITA|kita only, and tika gives no analysis.

PanGloss: PanGloss keeps the middle context in analysis and finds root tika. The conformance case will expect that once this is fixed.

Next: keep the middle context in the analysis pattern and add the fixture to the conformance suite.

🤖 Generated with Claude Code

Lingua principale
C#
Stelle
29
Fork
16
Merge medio
5g 11h
PR unite (30g)
15

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sillsdev/machine

Tutte le issue di sillsdev/machine

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.