DocumentationAddress parts

Address parts

Twelve parsed DOMICILIO components, nullable values, source offsets and warning codes.

On this page

New profile=extended readings include data.address_parts, a derived address projection. The original data.address and complete data.street line remain unchanged.

The twelve properties describe text inside DOMICILIO, not twelve electoral fields printed on every INE. Parsing uses the existing OCR strings; it does not call another model, query a postal database, expand abbreviations or verify that an address exists.

Component schema

When address_parts is present, every key below is a string or null.

KeyMeaning on the INEMarker / value
typePrinted street type, with abbreviations preserved.CALLE, C, AV
streetStreet name after supported number/unit labels are separated. Unlike data.street, this is not the complete street line.EJEMPLO
numberExplicit exterior/property number. Not a block, lot or number belonging to the street name.NO 012 → 012
unitInterior/apartment identifier.INT 04, DEPTO 04 → 04
buildingBuilding or tower identifier.EDIF B, TORRE B → B
blockManzana in the address, never electoral SECCIÓN.MZA 003 → 003
lotLote, distinct from exterior number.LT 007 → 007
neighborhoodExplicitly labelled colonia, fraccionamiento or barrio.COL DEMOSTRACION → DEMOSTRACION
localityExplicitly labelled locality or settlement.LOCALIDAD VILLA EJEMPLO → VILLA EJEMPLO
municipalityMunicipality, alcaldía or delegación supported by address text.MUNICIPIO EJEMPLO → EJEMPLO
stateResidence state text; not birthplace or a state derived from CURP.Printed abbreviation remains abbreviated.
zipPostal-code substring from data.postal_code, preserving zeros.C.P. 00100 → 00100

The table contains synthetic address fragments. Unsupported, missing, ambiguous or conflicting components remain null. A number inside a street name is not automatically an exterior number. A populated component can still contain an OCR transcription error.

Block, lot, unit and building

block means manzana and lot means lote. Some printed addresses use them instead of, or alongside, a house number. They are optional parts of the address and are not obtained from a cadastral or INE registry.

In the fictional line CALLE EJEMPLO NO 012 EDIF B INT 04 MZA 003 LOTE 007:

Printed fragmentPropertyMeaning
NO 012number: "012"Exterior/property number.
EDIF Bbuilding: "B"Building B.
INT 04unit: "04"Interior/apartment 04.
MZA 003block: "003"Manzana 003.
LOTE 007lot: "007"Lote 007.

MZA 003 LT 007 can populate block and lot while street and number remain null. CALLE EJEMPLO NO 012 supplies neither a block nor a lot. Absence is not zero and does not establish that the address is invalid.

The separate SECCIÓN label maps to data.section. A hypothetical SECCIÓN 0042 must not become a block, lot or postal code.

Neighborhood, locality and municipality

A colonia is a neighborhood; a localidad is a settlement; a municipio or alcaldía is an administrative area. Their names can overlap, but they have different roles. The parser does not copy one into another.

The existing data.neighborhood field may contain neighborhood or locality text. The parser requires a supported role label in that field or the original address before choosing address_parts.neighborhood or address_parts.locality. Unlabelled CENTRO alone does not establish the role. Missing municipality is not inferred from a locality, state or postal code.

Zip and postal code

data.postal_code preserves the OCR value. data.address_parts.zip is a substring of that value after a supported label is removed. For fictional C.P. 00100, the parsed value is 00100. The original field remains unchanged.

Both values are strings. Supported foreign postal-code notation is also preserved: an overseas INE is not assumed to have a five-digit Mexican code. Format support does not verify location or deliverability.

Address projection

Partial payload for identical synthetic street and address values, with no other address fields populated:

{
  "data": {
    "address": "CALLE EJEMPLO NO 012 EDIF B INT 04 MZA 003 LOTE 007",
    "street": "CALLE EJEMPLO NO 012 EDIF B INT 04 MZA 003 LOTE 007",
    "address_parts": {
      "type": "CALLE",
      "street": "EJEMPLO",
      "number": "012",
      "unit": "04",
      "building": "B",
      "block": "003",
      "lot": "007",
      "neighborhood": null,
      "locality": null,
      "municipality": null,
      "state": null,
      "zip": null
    }
  }
}

Address identifiers are strings; numeric conversion loses leading zeros and cannot represent alphanumeric values.

Source offsets

sources.address_parts has the same twelve keys. Each populated part has a source object; each null part has a null source. The projection above has this exterior-number source:

{
  "method": "parsed",
  "field": "street",
  "start": 17,
  "end": 20
}

field names an original value in data: street, address, neighborhood, municipality, state or postal_code. It never points into address_parts. Offsets are zero-based UTF-16 code units, with end exclusive, matching JavaScript String.slice.

const parts = result.data.address_parts;
const source = result.sources.address_parts?.number;

if (parts && source) {
  const original = result.data[source.field];
  const literal = original.slice(source.start, source.end);
  // literal === parts.number
}

Ordinary Python string indexes differ from UTF-16 code-unit indexes for characters outside the basic multilingual plane. These are text offsets, not image coordinates or confidence scores. They trace an OCR substring, not the accuracy of the printed document.

Warnings and older results

CodeInterpretation
address_parsing_unvalidatedParser coverage and accuracy are not validated on a representative input set.
address_component_ambiguousA component could not be separated reliably. field identifies a path such as address_parts.number.
address_source_conflictSource fields disagree about a part. The warning identifies the affected path.

needs_review remains true. The warning-code set is extensible; absence of warnings does not establish transcription correctness.

Parts are computed once for a new extended reading and saved with the result. GET and idempotent replay return the stored object. Older results may omit data.address_parts and sources.address_parts; absence indicates unavailable derived data. The standard profile does not include these objects. Parsing adds no separate reading unit.