fix(yandex-valuation): tighten area regex + chronological date ordering #541

Merged
lekss361 merged 1 commit from fix/tradein-yandex-parser-quality into main 2026-05-24 15:37:48 +00:00

1 commit

Author SHA1 Message Date
lekss361
961bdc0225 fix(yandex-valuation): tighten area regex + chronological date ordering
Three parser quality bugs observed on prod (Базовый 52 sweep, 132 rows):

A. RE_ITEM_AREA captured year+area concat like '202442,6' from chunked text
   where DOM whitespace was stripped between publish-year and area tokens.
   Added negative lookbehind + 4-digit cap on whole part.

B. Same regex sometimes matched a sub-fragment '2,2' inside '52,2' — same
   root cause, fixed by the tightened regex.

C. publish_date / removed_date were assigned by page-text order, not
   chronologically. ~1% of rows on prod had removed < publish. Sort the
   parsed date list before splitting.

Cap from prior PR #538 stays as belt-and-suspenders for any junk that
still slips through.
2026-05-24 18:28:22 +03:00