Handle Ukrainian year names (2022 p > 2022)
This commit is contained in:
parent
3c43a3f2d3
commit
81a7d64e27
|
@ -65,8 +65,13 @@ final class NodaTimeSplitter {
|
||||||
"nach Chr." => "",
|
"nach Chr." => "",
|
||||||
"n. Chr." => "",
|
"n. Chr." => "",
|
||||||
"n.Chr." => "",
|
"n.Chr." => "",
|
||||||
|
" pp" => "",
|
||||||
|
" p" => "",
|
||||||
|
" р" => "", // Cyrillic
|
||||||
// To clean
|
// To clean
|
||||||
"v.Chr." => "v. Chr.",
|
"v.Chr." => "v. Chr.",
|
||||||
|
"v.C." => "v. Chr.",
|
||||||
|
"v. C." => "v. Chr.",
|
||||||
"v. Chr" => "v. Chr.",
|
"v. Chr" => "v. Chr.",
|
||||||
"BCE" => "v. Chr.",
|
"BCE" => "v. Chr.",
|
||||||
"CE" => "",
|
"CE" => "",
|
||||||
|
|
|
@ -342,6 +342,19 @@ final class NodaTimeSplitterTest extends TestCase {
|
||||||
self::assertEquals(NodaTimeSplitter::timePartsToTimeName($output), "40000-25000 v. Chr.");
|
self::assertEquals(NodaTimeSplitter::timePartsToTimeName($output), "40000-25000 v. Chr.");
|
||||||
self::assertEquals(NodaTimeSplitter::timePartsToCountingYear($output), 32500);
|
self::assertEquals(NodaTimeSplitter::timePartsToCountingYear($output), 32500);
|
||||||
|
|
||||||
|
// 5-Digit timespans BCE
|
||||||
|
$output = NodaTimeSplitter::attempt_splitting("40000-25000 v.C.");
|
||||||
|
self::assertEquals($output, [
|
||||||
|
0 => "-40000",
|
||||||
|
1 => "-25000",
|
||||||
|
2 => "00",
|
||||||
|
3 => "00",
|
||||||
|
4 => "-",
|
||||||
|
5 => "",
|
||||||
|
]);
|
||||||
|
self::assertEquals(NodaTimeSplitter::timePartsToTimeName($output), "40000-25000 v. Chr.");
|
||||||
|
self::assertEquals(NodaTimeSplitter::timePartsToCountingYear($output), 32500);
|
||||||
|
|
||||||
$output = NodaTimeSplitter::attempt_splitting("20. Jahrhundert v. Chr.");
|
$output = NodaTimeSplitter::attempt_splitting("20. Jahrhundert v. Chr.");
|
||||||
self::assertEquals($output, [
|
self::assertEquals($output, [
|
||||||
0 => "-2000",
|
0 => "-2000",
|
||||||
|
@ -806,6 +819,31 @@ final class NodaTimeSplitterTest extends TestCase {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test to check whether the HTML page is correctly generated.
|
||||||
|
*
|
||||||
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
|
* @group ValidOutput
|
||||||
|
* @small
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testSplitSimpleDatesUkrainian():void {
|
||||||
|
|
||||||
|
$output = NodaTimeSplitter::attempt_splitting("2020 p");
|
||||||
|
self::assertEquals($output, [
|
||||||
|
0 => "2020",
|
||||||
|
1 => "2020",
|
||||||
|
2 => "00",
|
||||||
|
3 => "00",
|
||||||
|
4 => "+",
|
||||||
|
5 => "",
|
||||||
|
]);
|
||||||
|
self::assertEquals(NodaTimeSplitter::timePartsToTimeName($output), "2020");
|
||||||
|
self::assertEquals(NodaTimeSplitter::timePartsToCountingYear($output), 2020);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test to check special cases can be parsed.
|
* Test to check special cases can be parsed.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user