Skip to content

HermitCrab synthesis: an empty prefix allomorph is anchored at the word end, so its environment is checked on the wrong side #597

Closed as not planned

Description

@johnml1135

An affix allomorph that inserts no segments still gets a morph annotation, and synthesis always anchors it on the last node of the shape (SynthesisAffixProcessAllomorphRuleSpec.cs, the outputNewMorph == null branch). That is right for a suffix and wrong for a prefix. The allomorph's environment is then checked against Range.Start.Prev / Range.End.Next (AllomorphEnvironment.cs) at the word end, so a null prefix with an environment such as / _ [+nasal] is tested against the wrong neighbour.

Before #500, the next affix that wrapped the empty morph pulled it into that affix's range, so its environment was checked at a position that was usually wrong and sometimes right by accident. With #500, the empty morph stays on the last node of its stem. Suffixes come out right, and null prefixes are now consistently checked at the wrong end.

Measured on the stress grammars in #578 (env-bantu-concord, env-austronesian-nasal-prefix, env-zero-allomorphs), comparing with and without #500's hunk:

  • apani gains the spurious analysis R13+CONC+TAM: CONC's empty prefix needs a nasal to its right, which a word-initial prefix cannot have. 6 of the 10 changed Bantu words gain a parse of this kind, and tukina and timumina gain duplicates.
  • mempendasi, ntigugu and ntipubi lose analyses that were spurious before (the empty morph had been moved next to a nasal).
  • kanu gains P1+S1 and S1+P1, which were previously order-dependent.

The grammar XML carries no prefix/suffix side for an empty allomorph, so the fix needs a direction source (the rule's other allomorphs, its template slot, or the loader). Where the side is unknown, anchoring at the last node remains the fallback.

Done when: an empty prefix's environment is checked at the stem's left edge, apani parses only as R13+TAM, #500's fenos ID-order test still passes, and a conformance case for a null prefix with an environment is in #480.

Activity

  1. johnml1135 commented on Oct 30, 2026

    @johnml1135
    CollaboratorAuthor

    Closing as out of scope: a truly empty affix allomorph can be written in hand-made HermitCrab XML but not in a FieldWorks project. FLEx writes a null affix as a ^0 boundary inserted on the correct side (prefix: ^0+ before the stem; suffix: +^0 after it), so the morph has real nodes and its environment sees the right neighbour. A probe that built FLEx-style null prefixes and suffixes with left and right environments gave 8 of 8 correct results and never reached the outputNewMorph == null branch; only a truly empty allomorph did. The #578 stress grammars that hit this are being converted to the FLEx form.

  2. moved this from 🆕 New to ✅ Done in Servalon Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions