Enumerations
in package
implements
NodeRule
Enumeration values in 7.0 case and spelling (birth → BIRTH, PRE-1970 → PRE_1970, DNS/CAN → DNS_CAN). A value the 7.0 set does not have becomes OTHER with the value as PHRASE where 7.0 has both ("1 NAME … 2 TYPE Screen" → TYPE OTHER, PHRASE Screen), and stays as it is elsewhere; the event type a citation is from, whose set has no OTHER, is EVEN, the generic event, with the value as PHRASE ("2 EVEN Census of Galicia" → EVEN EVEN, PHRASE Census of Galicia). A 5.5.1 role description "(text)" is OTHER with PHRASE text.
ASSO.RELA, free text in 5.5.1, becomes ROLE: the value when it names a 7.0 role (friend → FRIEND), the role for a common word with the word as PHRASE (neighbor → NGHBR, PHRASE neighbor; "(godmother)" → GODP, PHRASE godmother), otherwise OTHER with PHRASE, and OTHER when it is empty. FORM.TYPE, the medium of a 5.5.1 media file, becomes FORM.MEDI.
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
- convert() : array{string, ?string}|null
- The 7.0 value and PHRASE of a value of a 5.5.1 element; null when it stays as it is.
- 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
convert()
The 7.0 value and PHRASE of a value of a 5.5.1 element; null when it stays as it is.
public
convert(string $element, string|null $value) : array{string, ?string}|null
Parameters
- $element : string
- $value : string|null
Return values
array{string, ?string}|nullneedsPrepass()
Whether the rule needs Context::prepass(): facts about the whole input before the first record.
public
needsPrepass() : bool
Return values
boolnode()
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
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