Add trim to place names for checking uncertainty also at start of

checker
This commit is contained in:
Joshua Ramon Enslin 2020-09-21 02:11:58 +02:00 committed by Stefan Rohde-Enslin
parent e53eec84e6
commit e4558ae227

View File

@ -116,6 +116,8 @@ final class NodaUncertaintyHelper {
*/
public static function cleanUncertaintyIndicatorsPlace(string $ort_name):string {
$ort_name = \trim($ort_name);
// Remove uncertainty prefixes
foreach (NodaUncertaintyHelper::PLACE_UNCERTAINTY_PREFIXES as $prefix) {
if (\substr($ort_name, 0, \strlen($prefix)) === "$prefix") {
@ -172,6 +174,8 @@ final class NodaUncertaintyHelper {
*/
public static function cleanUncertaintyIndicatorsPersinst(string $value):string {
$value = \trim($value);
foreach (self::PERSINST_UNCERTAINTY_PREFIXES as $toRemove) {
if (\mb_substr($value, 0, \mb_strlen($toRemove)) === $toRemove) {
$value = substr($value, \mb_strlen($toRemove));