Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve search for languages with accents #10567

Closed
Nekzuris opened this issue Nov 30, 2024 · 6 comments
Closed

Improve search for languages with accents #10567

Nekzuris opened this issue Nov 30, 2024 · 6 comments
Labels
waitfor Waiting for something

Comments

@Nekzuris
Copy link
Contributor

Description

Currently if a word is written with accents in Transifex, the user must include the accents to find it.
I know I could just add a synonym without accents, but that’s redundant. There are probably hundreds of missing synonyms like that.
The word should be written only once with the correct accents, and the search function should ignore them.

Screenshots

example with French (fr):
image image
image

@1ec5
Copy link
Collaborator

1ec5 commented Dec 1, 2024

Diacritic-insensitive search was implemented in #8242. You may manually provide diacritic-folded synonyms, as I’ve continued to do in Vietnamese. However, the results you’re seeing have a different cause: the word “pétanque” is such a small part of the overall preset name “Terrain de boules (Pétanque, Bocce…)” that other, shorter presets have a much shorter edit distance. If you search for “boules petanque” or even “petanque b”, this preset appears on top.

iD doesn’t expect a preset name to contain a gloss with a list of synonyms. The synonym string in your screenshot should also contain “pétanque” in the list, since iD boosts exact matches. Also note the instructions for the “Boules/Bocce Court” string:

Translate the primary name. Optionally, add equivalent synonyms on newlines in order of preference (press the Return key).

So you can also add “Pétanque” and “Bocce” on a separate lines in the same string to ensure that iD will find and prioritize these search terms. #6139 remains open for labeling the preset with the matching synonym instead of the main preset name.

@Nekzuris
Copy link
Contributor Author

Nekzuris commented Dec 1, 2024

Okay, thanks for the explanation.
I don’t want to add diacritic-folded synonyms as they’re pointless in French (I’d even like to remove them all, is that a good idea?)
I didn’t write the current translation with synonyms in parentheses, but I think it’s quite useful for the user. Can I leave them and write it like this:?

Terrain de boules (Pétanque, Bocce...)
Terrain de Pétanque
Terrain de Bocce

and remove "Terrain de" from the synonym string, so only Pétanque, Bocce, Lyonnaise?

@1ec5
Copy link
Collaborator

1ec5 commented Dec 1, 2024

Yes, I think it’s worth a try. If I’m reading the code correctly, it’ll consider the aliases when matching; all that’s missing is showing the alias as the search result.

You can also remove the diacritic-folded synonyms. I left them in the Vietnamese localization essentially to opt out of iD’s built-in diacritic folding. But Vietnamese and French are polar opposites regarding the importance of diacritical marks in search.

@tyrasd tyrasd added the waitfor Waiting for something label Dec 3, 2024
@tyrasd
Copy link
Member

tyrasd commented Dec 3, 2024

I think this will be solved by adding the respective aliases (and/or search terms) in transifex. Let's close this for now and see if that fixes it (feel free to reopen if the issue persists).

@tyrasd tyrasd closed this as completed Dec 3, 2024
@Nekzuris
Copy link
Contributor Author

Nekzuris commented Dec 3, 2024

How can I test this now? I updated on transifex and build iD from source but it didn't pull the latest translation.

@tyrasd
Copy link
Member

tyrasd commented Dec 4, 2024

Testing such changes is not super easy, as the translation files for the presets live in a separate repository (https://github.com/openstreetmap/id-tagging-schema) and are only updated for each new release.

That said, I just tested your changes locally and it seems to work fine now:

image

It will be available for everyone with the upcoming release in a couple of days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waitfor Waiting for something
Projects
None yet
Development

No branches or pull requests

3 participants