Add capability to split english decade terms (1920s)
This commit is contained in:
parent
bb4e2a727a
commit
fb327762dc
@ -896,7 +896,15 @@ final class NodaTimeSplitter {
|
|||||||
$bcBceIndicator = '+';
|
$bcBceIndicator = '+';
|
||||||
|
|
||||||
// 17. Jahrhundert
|
// 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))) {
|
if ($centuryNo = \intval(\substr($datum, 0, 2))) {
|
||||||
$centuryNo--;
|
$centuryNo--;
|
||||||
return [(string)$centuryNo . "01", \strval($centuryNo + 1) . "00", "00", "00", $bcBceIndicator, ""];
|
return [(string)$centuryNo . "01", \strval($centuryNo + 1) . "00", "00", "00", $bcBceIndicator, ""];
|
||||||
@ -962,7 +970,7 @@ final class NodaTimeSplitter {
|
|||||||
return [$start, $ende, "00", "00", $bcBceIndicator, ""];
|
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);
|
$start = \substr($datum, 0, 4);
|
||||||
$ende = (string)(\intval($start) + 9);
|
$ende = (string)(\intval($start) + 9);
|
||||||
return [$start, $ende, "00", "00", $bcBceIndicator, ""];
|
return [$start, $ende, "00", "00", $bcBceIndicator, ""];
|
||||||
|
Loading…
Reference in New Issue
Block a user