normalize_org_name keeps a partnership marker: a GmbH & Co KG no longer matches the GmbH
'Huber GmbH & Co KG' -> 'huber kg', 'Porsche Austria GmbH & Co OG' -> 'porsche austria og' (also &CoKG, KEG, OHG), 'Huber GmbH' -> 'huber'. Alias matching treated the partnership and its general partner (different legal entities) as one organisation. New legal_form_class(); firmenbuch.is_partnership uses it. Existing aliases are recomputed and the merged organisations split by a one-off script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c61cb31e4a
commit
1395dc2840
3 files changed
+44
-7
No files matched your search
@@ -37,7 +37,7 @@ from politrack.core import (
|
||||
)
|
||||
from politrack.core.records import Claim, Evidence, OrgRecord, OrgRef, PersonRef
|
||||
from politrack.core.spec import DERIVED
|
||||
from politrack.text import firmenbuch_number, format_eur_de, normalize_org_name
|
||||
from politrack.text import firmenbuch_number, format_eur_de, legal_form_class, normalize_org_name
|
||||
|
||||
URL = "https://justizonline.gv.at/jop/api/at.gv.justiz.fbw/ws"
|
||||
NS = "ns://firmenbuch.justiz.gv.at/Abfrage/"
|
||||
@@ -203,12 +203,9 @@ def search_term(name: str) -> str:
|
||||
return term if len(term) >= 3 else ""
|
||||
|
||||
|
||||
PARTNERSHIP = re.compile(r"\b(kg|og|kommanditgesellschaft|offene gesellschaft|co\.?\s*kg)\b", re.IGNORECASE)
|
||||
|
||||
|
||||
def is_partnership(name: str) -> bool:
|
||||
"""KG / OG / GmbH & Co KG: a different legal entity from the GmbH of the same name (often its general partner)."""
|
||||
return bool(PARTNERSHIP.search(name))
|
||||
return legal_form_class(name) in {"kg", "og"}
|
||||
|
||||
|
||||
def unique_match(name: str, hits: list[dict[str, Any]]) -> dict[str, Any] | None:
|
||||
|
||||
Reference in new issue
Block a user