HermitCrab: analysis metathesis drops the middle context that synthesis keeps

オープン
#619 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@johnml1135 がすでに取り組んでいます。

2026年11月6日 から。

  • #620 @johnml1135 による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp
領域
backend, testing

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
C#
スター
29
フォーク
16
平均マージ
3日 20時間
マージ済み PR(30日)
12

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sillsdev/machine のほかの issue

sillsdev/machine の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。