HermitCrab: allomorph environments are tested at each piece of a root split by an infix

Aperta
#630 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #631 di @johnml1135 — chiusa senza merge

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
csharp
Ambito
backend

Direzione di ricerca

Start by reading Allomorph.IsWordValid and AllomorphEnvironment.IsMatch, then inspect the infix tests in AffixProcessRuleTests.InfixRules. Add coverage for a conditioned root allomorph split by an infix, including the ginabas reproduction. Done means split pieces are evaluated using the context outside the first and last pieces, and the new test passes; linked PR #631 is already open.

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

Descrizione

When an infix splits a root, Allomorph.IsWordValid checks the root allomorph's environments once per piece, so infix segments count as the root's left and right context. A conditioned root allomorph can then block the elsewhere form in a word where its environment does not hold, and fail where it does.

Reproduction: root with allomorphs gabs / _ [V] then gabas (no environment), infix -in- after the first consonant, suffix -a.

Word Expected Actual
gabsa gabs + -a parses
gabas gabas parses
ginabas gabas + -in- no parse (DisjunctiveAllomorph)

In ginabas the root is word-final, so gabs / _ [V] does not apply. It is counted as applicable because the infix's i follows the piece g, and it blocks gabas. The same loop makes a conditioned allomorph fail if any single piece misses its environment.

Next: the linked PR groups the pieces by MorphID and tests the left context before the first piece and the right context after the last one.

Analysis
  • An infixation rule gives the root several morph annotations with one MorphID. Allomorph.IsWordValid loops over word.GetMorphs(this), and AllomorphEnvironment.IsMatch uses morph.Range.Start.Prev and morph.Range.End.Next of each piece.
  • Blocking: the disjunctive check treats an earlier allomorph as applicable if its environment holds at any piece.
  • Requirement: a conditioned allomorph must satisfy its environment at every piece, so an allomorph / _ [C] could never take a vowel-initial infix.
  • The per-morph loop came in with 987be2fd (2022-04-13, "Check specific morphs for disjunctive environments"), to tell separate applications of one allomorph apart. That is what MorphID records; pieces of one split root are not separate applications.
  • Found on v3.9.6 / 74ee09bf. I found no existing test combining an infix with a conditioned root allomorph (AffixProcessRuleTests.InfixRules is the only infix test).
  • Not checked: reduplication and compounding, where copied material might carry the root's MorphID.
Lingua principale
C#
Stelle
29
Fork
16
Merge medio
4g 11h
PR unite (30g)
14

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.