Strip away variations of n. Chr. from time strings for splitting
This commit is contained in:
parent
affe8e3741
commit
fd0bd48995
@ -41,6 +41,15 @@ final class NodaTimeSplitter {
|
||||
"12" => ['december', 'dec.'],
|
||||
];
|
||||
|
||||
const STRINGS_TO_CLEAN = [
|
||||
"között" => "",
|
||||
"nach Christus" => "",
|
||||
"n. Christus" => "",
|
||||
"nach Chr." => "",
|
||||
"n. Chr." => "",
|
||||
"n.Chr." => "",
|
||||
];
|
||||
|
||||
const STOP_STRINGS_GERMAN = [
|
||||
"-",
|
||||
",",
|
||||
@ -104,7 +113,7 @@ final class NodaTimeSplitter {
|
||||
|
||||
while (strpos($input, " -") !== false) $input = str_replace(" -", "-", $input);
|
||||
while (strpos($input, "- ") !== false) $input = str_replace("- ", "-", $input);
|
||||
if (stripos($input, "között") !== false) $input = str_replace("között", " ", $input);
|
||||
$input = strtr($input, self::STRINGS_TO_CLEAN);
|
||||
|
||||
return trim($input, ", [](){}");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user