Skip to content

[grammar] Trailing NBSP / combining marks excluded from mention spans #181

Description

@azaharizaman

Observed during ISIN work (#177); pre-existing shared-layer behavior, not ISIN-caused. Same trait reproduces on sibling capabilities sharing the boundary machinery.

Repro (on dev):

canonicalize('US0378331005\xa0', isin_contract) -> SUCCESS 'US0378331005' span=(0, 12)
canonicalize('US0378331005\u0301', isin_contract) -> SUCCESS 'US0378331005' span=(0, 12)

Trailing NBSP (U+00A0) and combining acute (U+0301) are silently left out of the span while the mention still succeeds.

Ask: decide the intended contract and pin it: (a) current behavior is correct — boundary guards treat these as non-word trailing context, document it; or (b) trailing NBSP/combining marks should void or join the mention. Likely touches shared boundary/guard code in paxman/core/grammar/, so the decision and its tests belong at the shared layer with per-capability parity runs, not in any single capability.

Acceptance sketch: explicit unit tests for NBSP/combining-mark adjacency (at least word_only-guarded capabilities); no silent behavior change for existing vectors.

Activity

  1. azaharizaman commented on Sep 22, 2026

    @azaharizaman
    CollaboratorAuthor

    Adjacent to PR #185 — not blocked, no dependency

    Noting a nearby change only, because both surface through result.span:

    • PR feat(gtin): GTIN capability (GS1 GenSpecs 26.0 + Prefix + Verified snapshot) #185 (GTIN + engine presentation-after-identity) changed the source of the single-value span in one narrow case: it is now taken from the first surviving candidate on the canonical-identity basis. For identity/injective formats this is bit-for-bit the old behavior; it only diverges for notation-keyed formats where one canonical renders differently per mention (e.g. rfc3966/native).
    • This issue lives entirely on the recognition side — boundary/guard treatment of trailing NBSP (U+00A0) / combining marks (U+0301) deciding the mention's [start, end). That machinery (paxman/core/grammar/) was not touched by feat(gtin): GTIN capability (GS1 GenSpecs 26.0 + Prefix + Verified snapshot) #185, and the (0, 12) repro above behaves identically on the PR branch.

    Relationship: adjacent, not blocked. Neither work item gates the other — a decision here ((a) document current behavior vs (b) void/join the mention) flows through recognition → candidate spans → surfaced span with no interaction with the presentation-vs-identity ordering, and #185's outcome doesn't constrain the span-boundary contract this issue must pin.

  2. added
    v1.0.0v1.0.0 release
    pending decisionItems that need decision to be codified first before it can be implemented or planned
    followupFollow-up from merged PR — deferred or skipped review concern
    on Sep 30, 2026
  3. azaharizaman commented on Sep 30, 2026

    @azaharizaman
    CollaboratorAuthor

    Triage 2026-09-30: keeping open, labeled v1.0.0 (tentative) + pending decision + followup (observed during PR #177). Plain English: when an ID is followed by an invisible space or accent mark, the ID is accepted but the invisible character is silently left out of the reported span; this issue asks for a recorded decision — keep and document that, or treat it as no-match/extend the match — with tests at the shared layer. Decision needed before any code change. No consolidation needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    followupFollow-up from merged PR — deferred or skipped review concernpending decisionItems that need decision to be codified first before it can be implemented or plannedv1.0.0v1.0.0 release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions