Replies: 2 comments
-
|
I thought there is already an issue about that but looks like I mixed that up with Nominatim issues. Long story short, apostrophes are easy in a monolingual context but a bit of a pain when you don't know what language the input is. OpenSearch has a token filter for English-style apostrophes but is very clear that this shouldn't be used on languages like French and Turkish. For French-style apostrophes there is the elision filter which in turn will cause havoc with English-style apostrophes. So sadly, there is no out-of-the-box solution here. For single letter elisions, we might get away with just deleting the apostrophe without replacing it with a space. Then let fuzzy search do the rest at the expense of getting slightly worse results occasionally. However, this will not a workable approach for in-word apostrophes: fuzziness cannot add/delete word breaks. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for taking the time to explain this, much appreciated. I'm adding this extra explanation for anyone who stumbles across this discussion (and so I remember it later): Photon initially attempts a search with a flag The search: With a small-ish bounding box: If I change the s in queens to an a: The summary is, there is an apostrophe issue, but there are also too many things named after Queen Victoria and Views. Limiting the search area by using a bounding box greatly improves the chances of success. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I'm using Photon to provide the geo search within our application for blind and visually impaired users and one of the things that I've noticed is that places with apostrophes are harder to search for than places without.
It's not always easy to know whether there should be an apostrophe or not - one example of this is Princes Street in Edinburgh which was originally called Prince's Street but had the apostrophe dropped. Unless you've seen it written down it's guesswork to get it right (I actually thought that it was named Princess Street...).
The good thing is that searching for "Prince's Street" does return "Princes Street":
https://photon.komoot.io/api/?q=Prince%27s%20Street,Edinburgh
However, in the case where there is an apostrophe in the name, e.g. "Queen's View" (https://www.openstreetmap.org/node/71235429) searching without the apostrophe does not find it:
https://photon.komoot.io/api/?q=Queens%20View,Stirling fails
https://photon.komoot.io/api/?q=Queen%27s%20View,Stirling succeeds
Until now I hadn't looked at the code, so please excuse my ignorance, but I'm guessing that
punctuationgreedyis what helps with dropping apostrophes when searching? What's interesting about that is that the apostrophe is replaced with a space. I experimented further and here's what works and doesn't work:Based on this a workaround in English might be for me to knock of the last
sin all search strings, though there are other cases where that wouldn't help e.g. "Bene't Street" in Cambridge. Searching on "Benet Street,Cambridge" doesn't succeed, though "Bene Street,Cambridge" does.I'm interested in any suggestions as to how to look at this further.
Many thanks,
Dave Craig.
Beta Was this translation helpful? Give feedback.
All reactions