Korin API

Structures
in package
implements NodeRule

FinalYes

The structures the target version does not have where they stand:

  • a structure the target has no place for (7.0 → 5.5.1: NO, SDATE, CREA, INIL, CROP, HEAD.SCHMA, an ASSO of an event, a PHRASE no value rule could join; 5.5.1 → 5.5: EMAIL, FAX, WWW, MAP, FONE, ROMN; 5.5 → 5.5.1: BLOB, the AGE of a family event; 5.5.1 → 7.0: NOTE and SOUR of a FONE or ROMN, which become TRAN) becomes an extension with its tag and its substructures (_NO, _EMAIL), or is dropped under LossPolicy::DropWithReport (KL2001);
  • one more than the target allows (5.5 → 5.5.1: a second PEDI; 5.5.1 → 5.5: a second REPO of a source) likewise (KL2002);
  • the value Y of an event the target has no value for (7.0 or 5.5 BURI Y → 5.5.1 BURI) is removed: an event without substructures means the same, one with them is reported (KL3003);
  • 5.5.5 and 7.0 have no structure with neither a value nor substructures: such a structure (1 BURI, BIRT Y, whose Y 5.5.5 does not have; 5.5.1 → 7.0: 1 BAPL, an empty SOUR.DATA) becomes an extension (KL3001);
  • a record the target does not have (SUBN in 5.5.5) becomes an extension record (KL2001).

Converting back gives the structures back (the rule Extensions). The last rule of the walk: it sees the tags the other rules wrote.

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

__construct()  : mixed
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

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