Spellings
in package
implements
NodeRule
Values 4.0 writes in words (GEDCOM 4.0, chapter 5), in the form 5.5 has for them:
- SEX Male, Female → M, F;
- a date with English month names, "Abt.", "Before", "Between … and …", "From … to …" (11 June 1861, Abt. 1850) → the 5.5 date when it then fits 5.5 (11 JUN 1861, ABT 1850);
- any other date that does not fit 5.5, which 4.0 calls irregular and keeps "as it appears in the source" (4/5 January 1751/52, 7-12-84) → a 5.5 date phrase, "(4/5 January 1751/52)".
The meaning is the same and nothing is reported, as with other spellings (5.5 FORM jpeg → 5.5.1 jpg). A date with "@" or a parenthesis stays as it is.
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
- date() : string|null
- The 5.5 form of a 4.0 date; null for one that fits 5.5 already, or has "@" or a parenthesis.
- 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
date()
The 5.5 form of a 4.0 date; null for one that fits 5.5 already, or has "@" or a parenthesis.
public
static date(string $value) : string|null
Parameters
- $value : string
Return values
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