Extend tests to ensure "vermutl." is included in place uncertainty

indicators
This commit is contained in:
Joshua Ramon Enslin 2023-11-18 01:36:01 +01:00
parent 700fefd28c
commit a102758606
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -23,8 +23,8 @@ final class NodaUncertaintyHelperTest extends TestCase {
*/ */
public function testCleanUncertaintyIndicatorsTime():void { public function testCleanUncertaintyIndicatorsTime():void {
self::assertEquals(NodaUncertaintyHelper::cleanUncertaintyIndicatorsTime("wohl 1950"), "1950"); self::assertEquals("1950", NodaUncertaintyHelper::cleanUncertaintyIndicatorsTime("wohl 1950"));
self::assertEquals(NodaUncertaintyHelper::cleanUncertaintyIndicatorsTime("1950"), "1950"); self::assertEquals("1950", NodaUncertaintyHelper::cleanUncertaintyIndicatorsTime("1950"));
} }
@ -38,8 +38,8 @@ final class NodaUncertaintyHelperTest extends TestCase {
*/ */
public function testGuessTimeCertainty():void { public function testGuessTimeCertainty():void {
self::assertEquals(NodaUncertaintyHelper::guessTimeCertainty("wohl 1950"), false); self::assertFalse(NodaUncertaintyHelper::guessTimeCertainty("wohl 1950"));
self::assertEquals(NodaUncertaintyHelper::guessTimeCertainty("1950"), true); self::assertTrue(NodaUncertaintyHelper::guessTimeCertainty("1950"));
} }
@ -53,8 +53,12 @@ final class NodaUncertaintyHelperTest extends TestCase {
*/ */
public static function testCleanUncertaintyIndicatorsPlace():void { public static function testCleanUncertaintyIndicatorsPlace():void {
self::assertEquals(NodaUncertaintyHelper::cleanUncertaintyIndicatorsPlace("wohl Berlin"), "Berlin"); self::assertEquals("Berlin", NodaUncertaintyHelper::cleanUncertaintyIndicatorsPlace("wohl Berlin"));
self::assertEquals(NodaUncertaintyHelper::cleanUncertaintyIndicatorsPlace("Berlin"), "Berlin"); self::assertEquals("Berlin", NodaUncertaintyHelper::cleanUncertaintyIndicatorsPlace("Berlin"));
// Real-life examples that previously passed unencumbered
self::assertEquals("Augsburg", NodaUncertaintyHelper::cleanUncertaintyIndicatorsPlace("vermutlich: Augsburg"));
self::assertEquals("Augsburg", NodaUncertaintyHelper::cleanUncertaintyIndicatorsPlace("vermutl. Augsburg"));
} }
@ -68,10 +72,13 @@ final class NodaUncertaintyHelperTest extends TestCase {
*/ */
public static function testGuessPlaceCertainty():void { public static function testGuessPlaceCertainty():void {
self::assertEquals(NodaUncertaintyHelper::guessPlaceCertainty("wohl Berlin"), false); self::assertFalse(NodaUncertaintyHelper::guessPlaceCertainty("vermutlich: Augsburg"));
self::assertEquals(NodaUncertaintyHelper::guessPlaceCertainty("Berlin"), true); self::assertFalse(NodaUncertaintyHelper::guessPlaceCertainty("vermutl. Augsburg"));
self::assertEquals(NodaUncertaintyHelper::guessPlaceCertainty("?-Italien"), false); self::assertFalse(NodaUncertaintyHelper::guessPlaceCertainty("wohl Berlin"));
self::assertTrue(NodaUncertaintyHelper::guessPlaceCertainty("Berlin"));
self::assertFalse(NodaUncertaintyHelper::guessPlaceCertainty("?-Italien"));
} }
@ -85,9 +92,9 @@ final class NodaUncertaintyHelperTest extends TestCase {
*/ */
public static function testCleanUncertaintyIndicatorsPersinst():void { public static function testCleanUncertaintyIndicatorsPersinst():void {
self::assertEquals(NodaUncertaintyHelper::cleanUncertaintyIndicatorsPersinst("wohl Barbarossa"), "Barbarossa"); self::assertEquals("Barbarossa", NodaUncertaintyHelper::cleanUncertaintyIndicatorsPersinst("wohl Barbarossa"));
self::assertEquals(NodaUncertaintyHelper::cleanUncertaintyIndicatorsPersinst("Barbarossa"), "Barbarossa"); self::assertEquals("Barbarossa", NodaUncertaintyHelper::cleanUncertaintyIndicatorsPersinst("Barbarossa"));
self::assertEquals(NodaUncertaintyHelper::cleanUncertaintyIndicatorsPersinst("?-Barbarossa"), "Barbarossa"); self::assertEquals("Barbarossa", NodaUncertaintyHelper::cleanUncertaintyIndicatorsPersinst("?-Barbarossa"));
} }
@ -101,8 +108,8 @@ final class NodaUncertaintyHelperTest extends TestCase {
*/ */
public static function testGuessPersinstCertainty():void { public static function testGuessPersinstCertainty():void {
self::assertEquals(NodaUncertaintyHelper::guessPlaceCertainty("wohl Barbarossa"), false); self::assertFalse(NodaUncertaintyHelper::guessPlaceCertainty("wohl Barbarossa"));
self::assertEquals(NodaUncertaintyHelper::guessPlaceCertainty("Barbarossa"), true); self::assertTrue(NodaUncertaintyHelper::guessPlaceCertainty("Barbarossa"));
} }
} }