pragha-music-player / pragha

Pragha is a Lightweight Music Player for GNU/Linux.
GNU General Public License v3.0
173 stars 35 forks source link

Search similar words doesn't find Irish song titles #146

Closed kalikiana closed 4 years ago

kalikiana commented 5 years ago

It would be great if I could type Óró sé do bheatha 'bhaile by just typing oro without worrying about the diactrics. In technical terms the search would need to find words by their canonicalized unicode characters.

matiasdelellis commented 5 years ago

Hi @kalikiana There is an option for "Search similar words", clicking on the magnifying glass of search entry.

Today it is quite rigid since it uses levenshtein distance up to 1 character.. and in the proposed case it should work.. :wink:

matiasdelellis commented 5 years ago

p.s: I'm seeing you continue with Midori .. I'm very happy !! :smiley:

kalikiana commented 5 years ago

There is an option for "Search similar words", clicking on the magnifying glass of search entry.

Today it is quite rigid since it uses levenshtein distance up to 1 character.. and in the proposed case it should work.. wink

Hmmm so I enabled that option and it works in most cases like Jö schau, Pokëmon, Ill Niño or Zé Glisse, but not for Óró sé do bheatha 'bhail

matiasdelellis commented 5 years ago

D'Oh!. 'Óró' vs 'Oro' has an levenshtein distance of 2 characters.. :sweat_smile:

See that: https://github.com/pragha-music-player/pragha/blob/8eb706e4482cc0966bdfbe96e49db17b00092a83/src/pragha-filter-dialog.c#L184

As comment before, now it is very rigid. It only check differences of 1 character, and it does not differentiate between if it is the same letter with different accentuation or a completely different letter.. :disappointed:

The ideal would be to ignore when it was the same letter with different accentuation. But I see it difficult and expensive at the CPU level.. Probably the best we can do is to make it more flexible, for example using distance 2 when the needle has at least 4 characters

matiasdelellis commented 5 years ago

Hi @kalikiana Can you test the last commit?. (If you use 1.3, you can apply the patch cleanly). Thanks, and sorry for the delay ..