fix(geocode): keep a leading "the" in keyless name matching

foldPlaceName drops a leading "the", so "The Hague" over upstate New
York accepted Hague, NY as an exact nearby match. Split the script-aware
fold into foldPlaceText and use it for keyless toponyms; foldPlaceName
keeps its behaviour for the packs and street matchers.

Also: changelog fragment credits #1585, folding test pins the Latin
letters NFD does not decompose (ß, ø, ł), and CURRENT-STATE notes that
non-Latin names match only when spelled with their marks.
This commit is contained in:
Said Turksever committed 2026-11-05 17:13:00 +00:00
1 parent e4fda9d4e6
commit bc65c274da
5 files changed
+48 -14

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
import { foldPlaceName } from './data/placeNames.js';
import { foldPlaceText } from './data/placeNames.js';
/** Photon/OpenStreetMap place-search adapter. */
const PHOTON_ENDPOINT = 'https://photon.komoot.io/api/';
@@ -243,7 +243,7 @@ export function photonSearchUrl(
* @returns {string}
*/
export function normalizeToponym(text) {
return foldPlaceName(text);
return foldPlaceText(text);
}
/**