Module shorthand
Expand description
Canonical parser and data model for Document Character (Dc) shorthands.
Implements shorthand syntax according to README.shorthand.md:
- Bare integer: short Dc (
\d+) uprefix: Unicode character, hexadecimal (u[0-9a-f]+)fprefix: Format Dc (f\d+)lprefix: Long Dc (l\d+)Lprefix: Local graph ID (L\d+)
Shorthand tokens are strictly case-sensitive. Valid shorthands match
[flL]?\d+ or u[0-9a-f]+; non-matching strings are rejected.
Enums§
- DcShorthand
- Representation of a parsed Document Character (Dc) shorthand identifier.
Constants§
- MAX_
FORMAT_ ID - Maximum valid short Format ID.
- MAX_
SHORT_ DC - Maximum valid short Dc ID.
Functions§
- is_
valid_ shorthand - Checks whether a string conforms to the shorthand format regex
[flL]?\d+oru[0-9a-f]+and valid range boundaries. - parse_
format_ shorthand - Parses a format ID shorthand string, accepting either
f<digits>or bare<digits>. - parse_
unicode_ shorthand - Parses a Unicode shorthand string (
u[0-9a-f]+).