Korin API

Dates
in package
implements NodeRule

Read onlyYes
FinalYes

Dates by the 5.5.1 grammar: calendar names become escapes (JULIAN → @#DJULIAN@, FRENCH_R → @#DFRENCH R@, _ROMAN 24 _IUL 15 → @#DROMAN@ 24 IUL 15), BCE → B.C. A PHRASE joins the date as the 5.5.1 date it came from when converting up: the PHRASE itself when it is that date (DATE 30 JAN 1649 + PHRASE 30 JAN 1648/49 → 30 JAN 1648/49), otherwise "INT date (phrase)", or "(phrase)" without a date (the PHRASE as it is when it has parentheses).

Every value is one that converts up to the same date and PHRASE again. A PHRASE that cannot join an approximate date or a range (ABT 1900 + PHRASE) stays for the structures rule; a date with no 5.5.1 form (an extension calendar) is kept as an extension, _DATE (KL3001).

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
down()  : string|null
The 7.0 date in 5.5.1 words: escapes for calendars, B.C. for BCE, months without "_"; null for a calendar 5.5.1 does not have.
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

__construct()

public __construct() : mixed

down()

The 7.0 date in 5.5.1 words: escapes for calendars, B.C. for BCE, months without "_"; null for a calendar 5.5.1 does not have.

public down(string $date) : string|null
Parameters
$date : 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

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