Korin API

Languages
in package
implements NodeRule

FinalYes

Languages as BCP 47 tags: the 5.5.1 language names (case-insensitive) map to their tags as in the gedcom7code converter, except Dogri, which is "doi" (it writes "dgr", Dogrib). A value that already is a tag of a 2- or 3-letter language ("uk", "en-GB") stays; any other becomes "und" with the value in an extension _PHRASE (7.0 LANG has no PHRASE), as gedcom7code does; HEAD.SCHMA documents it (Schema).

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

name()  : string|null
The 5.5.1 language name of a BCP 47 tag ("uk" → "Ukrainian"), spelled as 5.5.1 lists it; null when it has none.
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.
tag()  : string|null
The BCP 47 tag of a 5.5.1 language: the value itself when it already is one; null when there is none.
tags()  : array<int, string>|null

Methods

name()

The 5.5.1 language name of a BCP 47 tag ("uk" → "Ukrainian"), spelled as 5.5.1 lists it; null when it has none.

public static name(string $tag) : string|null
Parameters
$tag : string
Return values
string|null

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

tag()

The BCP 47 tag of a 5.5.1 language: the value itself when it already is one; null when there is none.

public static tag(string $value) : string|null
Parameters
$value : string
Return values
string|null

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