Identify uncertainty before brackets ("Berlin ? (Germany)" > "Berlin
(Germany)" + Uncertain)
This commit is contained in:
@ -328,6 +328,14 @@ final class NodaUncertaintyHelper {
|
||||
}
|
||||
}
|
||||
|
||||
// If brackets are included in the name, try removing prefixes and suffixes
|
||||
// from the beginning.
|
||||
if (($bracketPos = strpos($ort_name, "(")) !== false) {
|
||||
$start = substr($ort_name, 0, $bracketPos);
|
||||
$end = substr($ort_name, $bracketPos);
|
||||
$ort_name = self::cleanUncertaintyIndicatorsPlace($start) . ' ' . $end;
|
||||
}
|
||||
|
||||
return self::trim($ort_name);
|
||||
|
||||
}
|
||||
@ -358,6 +366,13 @@ final class NodaUncertaintyHelper {
|
||||
}
|
||||
}
|
||||
|
||||
// If brackets are included in the name, try the same for everything up to the
|
||||
// first brackets.
|
||||
if (($bracketPos = strpos($ort_name, "(")) !== false) {
|
||||
$name = substr($ort_name, 0, $bracketPos);
|
||||
return self::guessPlaceCertainty($name);
|
||||
}
|
||||
|
||||
return true; // Certain / no uncertainty found
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user