Honorific/name-prefix stripping is implemented twice, once per language:
rust/src/names/prefix.rs — remove_person_prefixes / remove_org_prefixes / remove_obj_prefixes, consumed only by the Rust analyze_names pipeline (names/analyze.rs). Not exported via PyO3.
rigour/names/prefix.py — public API (re-exported from rigour.names), used downstream by followthemoney (compare.py) and nomenklatura (match.py, compat.py).
Both independently build the identical ^\W*((alt|…)\.?\s+)* case-insensitive regex from the same _core prefix lists, but one goes through Rust regex and the other through Python re. Any drift in escaping or case-folding semantics would silently desync the public helpers from the analyze pipeline.
Proposed fix: export the three Rust functions through _core (+ stub entries in rigour/_core.pyi) and turn rigour/names/prefix.py into a thin wrapper, leaving one implementation.
🤖 Generated with Claude Code
Honorific/name-prefix stripping is implemented twice, once per language:
rust/src/names/prefix.rs—remove_person_prefixes/remove_org_prefixes/remove_obj_prefixes, consumed only by the Rustanalyze_namespipeline (names/analyze.rs). Not exported via PyO3.rigour/names/prefix.py— public API (re-exported fromrigour.names), used downstream by followthemoney (compare.py) and nomenklatura (match.py,compat.py).Both independently build the identical
^\W*((alt|…)\.?\s+)*case-insensitive regex from the same_coreprefix lists, but one goes through Rustregexand the other through Pythonre. Any drift in escaping or case-folding semantics would silently desync the public helpers from the analyze pipeline.Proposed fix: export the three Rust functions through
_core(+ stub entries inrigour/_core.pyi) and turnrigour/names/prefix.pyinto a thin wrapper, leaving one implementation.🤖 Generated with Claude Code