[object Object]

← back to Rentv

fix(deals): word-boundary-anchor street suffixes so 'St' stops truncating names like 'North State St' → full 'North State Street'

63833d1ac4a003ba91b47a97334ea1afc46f55e7 · 2026-08-06 05:31:38 -0700 · Steve

Files touched

Diff

commit 63833d1ac4a003ba91b47a97334ea1afc46f55e7
Author: Steve <steve@designerwallcoverings.com>
Date:   Thu Aug 6 05:31:38 2026 -0700

    fix(deals): word-boundary-anchor street suffixes so 'St' stops truncating names like 'North State St' → full 'North State Street'
---
 scripts/pull-deals.mjs | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/scripts/pull-deals.mjs b/scripts/pull-deals.mjs
index 286cad8c..0235f685 100644
--- a/scripts/pull-deals.mjs
+++ b/scripts/pull-deals.mjs
@@ -89,10 +89,15 @@ function parseSize(text) {
 }
 
 function parseAddress(body) {
-  // NOTE: the bare "at" cue is word-boundary-anchored (\bat) so it only matches "at" as a
-  // standalone word — not the trailing "at" inside format/that/flat/combat, which previously
-  // false-extracted an address from ordinary prose (e.g. "the new format 1200 Broadway St layout").
-  const m = body.match(/(?:located at|situated at|address is|\bat)\s+(\d{2,6}\s[A-Z][A-Za-z0-9.\- ]+?(?:Rd|Road|St|Street|Ave|Avenue|Blvd|Boulevard|Dr|Drive|Way|Ln|Lane|Pl|Place|Ct|Court|Pkwy|Parkway|Hwy|Highway)\.?)/);
+  // Two anchors keep this precise: (1) the bare "at" cue is word-boundary-anchored (\bat) so it
+  // only fires on "at" as a standalone word, not the trailing "at" inside format/that/flat/combat
+  // (which false-extracted addresses from ordinary prose, e.g. "the new format 1200 Broadway St").
+  // (2) the street-suffix group is trailed by \b so a short suffix like "St"/"Ave" matches only as a
+  // whole token — without it the lazy name class stopped at the "St" INSIDE the street name itself
+  // ("1200 North State Street" → corrupted "1200 North St"; "300 Stewart Street" → "300 Stewart St").
+  // Dropping the old optional-period capture avoids trailing sentence punctuation now that suffixes
+  // match in full. A suffix not in this list (e.g. Plaza) now yields null (honest-empty) over a corrupt abbrev.
+  const m = body.match(/(?:located at|situated at|address is|\bat)\s+(\d{2,6}\s[A-Z][A-Za-z0-9.\- ]+?(?:Rd|Road|St|Street|Ave|Avenue|Blvd|Boulevard|Dr|Drive|Way|Ln|Lane|Pl|Place|Ct|Court|Pkwy|Parkway|Hwy|Highway)\b)/);
   return m ? m[1].trim() : null;
 }
 function parseOccupancy(body) { const m = body.match(/(\d{1,3})%\s?(?:leased|occup)/i); return m ? +m[1] : null; }

← c9a19a7c fix(deals): word-boundary-anchor the bare 'at' address cue s  ·  back to Rentv  ·  auto-save: 2026-08-06T05:48:58 (7 files) — data/deals-regist b0c8d34c →