Extend time splitter to handle e.g. "17./18. Jh."

This commit is contained in:
Joshua Ramon Enslin 2021-05-07 16:25:50 +02:00
parent db6953ca51
commit 874cfb8a6f
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -912,7 +912,10 @@ final class NodaTimeSplitter {
}
// 17.-18. Jahrhundert
if (\preg_match("/^[0-9]{2}(\.|)(|\ Jh\.||\ Jahrhundert||\ sz||\ század)\-[0-9]{2}\.\ (Jh\.|Jahrhundert|sz|század)$/", $datum)) {
if (\preg_match("/^[0-9]{2}(\.|)(|\ Jh\.||\ Jahrhundert||\ sz||\ század)(\-|\/)[0-9]{2}\.\ (Jh\.|Jahrhundert|sz|század)$/", $datum)) {
if (\strpos($datum, '/') !== false) {
$datum = str_replace('/', '-', $datum);
}
if (($dashPos = \strpos($datum, "-")) !== false) {
return self::negotiate_century_span_bce_ce(\substr($datum, 0, 2), \substr($datum, $dashPos + 1, 2));
}