Extracts the unit from a raw PF_15_G_PAID_RECIP_ADDR_L2 value and returns
it in npmatch's canonical street_unit spelling — "STE 400", "FL 2",
"# 206" — or "" where the line holds no unit.
Details
The parse itself is npmatch's: the value is passed to npmatch::np_normalize()
as a unit column and street_unit is read back, so pfmatch compares units
the same way the matcher does and a normalizer change moves both together.
Values are de-duplicated before normalizing, since line 2 repeats heavily.
Two rejections are applied on top, because ADDR_L2 is not a unit field —
street lines, city names, PO boxes and prose all appear in it. Both apply
only to a bare identifier, one carrying no designator; a value with an
explicit designator is always read as a unit.
No digits.
STREET,WAYandCONSERVANCYare real values of this field, and npmatch's bare-identifier path reads each as a unit id. The digit requirement is pfmatch's, and it is why it belongs on the bare path only:SUITE Bis a real suite with no digit in it.A box number at a box street. At
211 EMMET STREET SOUTH PO BOX, the400891on line 2 is a box, not a door. See.PF_BOX_RE.
See also
pf_unit_evidence(), and dev/UNIT-UPSTREAM-SYNC.md for the
decisions this delegation settles.