Documentation
¶
Overview ¶
Package ids is the single source of truth for node-ID normalization.
Adapted from Graphify's graphify/ids.py (Apache-2.0). The recipe must stay byte-for-byte identical to Graphify so graph.json files produced by either tool reference the same node IDs.
The recipe: iterate casefold then NFKC to a fixpoint, then replace runs of non-word characters with a single underscore, collapse repeated underscores and strip leading/trailing underscores.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsWord ¶
IsWord reports whether r matches Python's `\w` under re.UNICODE: alphanumeric characters (str.isalnum) and the underscore.
func MakeID ¶
MakeID builds a canonical node ID from one or more name parts.
Empty parts are skipped, every part has stray '_' / '.' trimmed from its edges, the parts are joined with '_' and the result is normalized.
func NormalizeID ¶
NormalizeID converts s to its canonical ID form.
It is idempotent, caseless-stable and the result only contains word characters (as defined by Python's re \w with re.UNICODE) and '_'.
Types ¶
This section is empty.