fix(address): extract scara/etaj/apartament from comma-less addresses
Oracle parser failed to extract sc/ap/et when GoMag addresses had no commas. Added REGEXP_REPLACE to insert commas before address keywords in v_strada before the comma-split, ensuring the token parser always fires. Also added 5 Oracle integration tests calling parseaza_adresa_semicolon directly, and improved diacritics handling in addr_match (Python + JS). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ CREATE OR REPLACE PACKAGE PACK_IMPORT_PARTENERI AS
|
||||
-- 07.04.2026 - fix parser adrese: inserare virgule inaintea keywords, tokeni lipiti (Ap78), strip localitate din strada
|
||||
-- 07.04.2026 - fix duplicate: normalize localitate + resolve id_localitate inainte de TIER 1 (match pe id_loc)
|
||||
-- 07.04.2026 - fix localitate necunoscuta: SOUNDEX fuzzy match (TIER L2) + pastreaza judetul in L3
|
||||
-- 08.04.2026 - fix parser: inserare virgule in strada inainte de comma-split (sc/ap/et nu se extrageau fara virgula)
|
||||
|
||||
-- ====================================================================
|
||||
-- CONSTANTS
|
||||
@@ -441,6 +442,7 @@ CREATE OR REPLACE PACKAGE BODY PACK_IMPORT_PARTENERI AS
|
||||
END separa_nume_prenume;
|
||||
|
||||
-- 31.03.2026 - parser inteligent: split numar in bloc/scara/apart/etaj (fix ORA-12899 pe NUMAR max 10 chars)
|
||||
-- 08.04.2026 - fix: inserare virgule in strada inainte de comma-split (sc/ap/et nu se extrageau fara virgula)
|
||||
PROCEDURE parseaza_adresa_semicolon(p_adresa_text IN VARCHAR2,
|
||||
p_judet OUT VARCHAR2,
|
||||
p_localitate OUT VARCHAR2,
|
||||
@@ -518,6 +520,13 @@ CREATE OR REPLACE PACKAGE BODY PACK_IMPORT_PARTENERI AS
|
||||
p_strada := SUBSTR(v_componente(3), 1, 100);
|
||||
v_strada := p_strada;
|
||||
|
||||
-- 08.04.2026 - insert commas before address keywords so comma-split always fires
|
||||
-- Reuses same regex as v_raw_numar comma insertion (lines below)
|
||||
-- Ex: "Str X nr 26 bl 6 sc 2 ap 36" → "Str X,nr 26,bl 6,sc 2,ap 36"
|
||||
v_strada := REGEXP_REPLACE(v_strada,
|
||||
'(\s)(BLOC|BL|SCARA|SC|APARTAMENT|APART|AP|ETAJ|ET|NUMARUL|NUMAR|NR)(\s|\.|\d)',
|
||||
',\2\3', 1, 0, 'i');
|
||||
|
||||
-- Separa strada de tot ce e dupa prima virgula
|
||||
v_pozitie := INSTR(v_strada, ',');
|
||||
IF v_pozitie > 0 THEN
|
||||
|
||||
Reference in New Issue
Block a user