Add capability to split english decade terms (1920s)

This commit is contained in:
Joshua Ramon Enslin 2021-08-27 16:19:19 +02:00
parent bb4e2a727a
commit fb327762dc
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -896,7 +896,15 @@ final class NodaTimeSplitter {
$bcBceIndicator = '+';
// 17. Jahrhundert
if (\preg_match("/^[0-9][0-9]\.\ (Jh\.|Jahrhundert|sz|század)$/", $datum)) {
if (\preg_match("/^[0-9]{2}\.\ (Jh\.|Jahrhundert|sz|század)$/", $datum)) {
if ($centuryNo = \intval(\substr($datum, 0, 2))) {
$centuryNo--;
return [(string)$centuryNo . "01", \strval($centuryNo + 1) . "00", "00", "00", $bcBceIndicator, ""];
}
}
// 17th century
if (\preg_match("/^[0-9]{2}th century$/", $datum)) {
if ($centuryNo = \intval(\substr($datum, 0, 2))) {
$centuryNo--;
return [(string)$centuryNo . "01", \strval($centuryNo + 1) . "00", "00", "00", $bcBceIndicator, ""];
@ -962,7 +970,7 @@ final class NodaTimeSplitter {
return [$start, $ende, "00", "00", $bcBceIndicator, ""];
}
if (\preg_match("/^[0-9]{3}0(er|er\ Jahre|\-es\ évek|\-as\ \évek)$/", $datum)) {
if (\preg_match("/^[0-9]{3}0(s|er|er\ Jahre|\-es\ évek|\-as\ \évek)$/", $datum)) {
$start = \substr($datum, 0, 4);
$ende = (string)(\intval($start) + 9);
return [$start, $ende, "00", "00", $bcBceIndicator, ""];