The compressed vocabulary of paxman/capabilities/*/grammar/ and
paxman/core/grammar/. Terms graduate here only once demonstrated in practice.
[start, end): start included, end excluded — identical
to Python slice/range convention. End is always one past the last matched character.
_Avoid_: “position pair”, index math without the bracket notation.notation, start, end, raw_text, with invariant
len(raw_text) == end − start enforced at construction. Spans are relative to the
original input text.
_Avoid_: bare notation, tuple spans.Grammar ABC: implements
recognize(text) → list[RecognitionMatch] plus identity (name,
non-empty semantics). Emits matches; owns no cross-match policy.
_Avoid_: parser, lexer, validator.CountryNotation(shape="name", value=raw)). Carries no canonical meaning and no
validity judgment. One notation type per capability (NotationT generic).(start, end, active-set index, grammar name).| Path | What lives there |
|---|---|
| paxman/core/domain.py | Grammar ABC (~L299), RecognitionMatch (~L68) — the contract source of truth |
| paxman/core/grammar/ | Kernel: scan_context, normalizers, boundary_spec, lexicon, composer, engine_loop |
| paxman/core/grammar/matchers/ | lexicon · regex · scanner · combinator · label · property · candidates |
| paxman/capabilities/<Cap>/grammar/ | One module per representation form (<name>_recognition.py) |
| paxman/capabilities/<Cap>/capability.py | get_grammars() wiring — the registry of that capability's grammars |
| ARCHITECTURE.md L17–48 | Separation principle + Recognition Pipeline Contract |
| HOW_TO_ADD_NEW_GRAMMAR.md | Step-by-step guide incl. strategy choice & TDD flow |
RecognitionMatch/Grammar docstrings.