Korin API

Addresses
in package
implements NodeRule

FinalYes

5.5.1 ADDR has a value, the address as lines; 5.5.5 has none. The value is the first substructure _ADDR, where the conversion to 5.5.5 keeps a value it cannot write, or else the lines ADR1–ADR3, or else CITY, STAE POST and CTRY on one line ("Kyiv, 01001, Ukraine"). An address with none of them stays without a value.

Table of Contents

Interfaces

NodeRule
A rule for one structure at a time. Rules that look at every line of a record are grouped in {@see Rule\Nodes}, which walks each record once for all of them.

Methods

compose()  : string
CITY, STAE POST and CTRY of an address as one line; empty when it has none of them.
needsPrepass()  : bool
Whether the rule needs Context::prepass(): facts about the whole input before the first record.
node()  : bool
Converts one structure (a record or a substructure; never a CONC/CONT line) with one of the rule's tags, as the structure is tagged when the walk reaches it, in place. Its substructures are visited after it, as they are when this returns.
tags()  : array<int, string>|null

Methods

compose()

CITY, STAE POST and CTRY of an address as one line; empty when it has none of them.

public static compose(Document $document, int $address, Context $context) : string
Parameters
$document : Document
$address : int
$context : Context
Return values
string

needsPrepass()

Whether the rule needs Context::prepass(): facts about the whole input before the first record.

public needsPrepass() : bool
Return values
bool

node()

Converts one structure (a record or a substructure; never a CONC/CONT line) with one of the rule's tags, as the structure is tagged when the walk reaches it, in place. Its substructures are visited after it, as they are when this returns.

public node(Document $document, int $id, Context $context) : bool
Parameters
$document : Document
$id : int
$context : Context
Return values
bool —

false when the rule removed the structure: the rules after it and its substructures are skipped

tags()

public tags() : array<int, string>|null
Return values
array<int, string>|null —

the tags of the structures the rule converts; null for every structure

On this page

Search results