musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
11.79k stars 2.56k forks source link

[MU4 Issue] Implement fuzzy text search #15983

Open raphj opened 1 year ago

raphj commented 1 year ago

Describe the bug

The search box for musical items will not be very forgiving if you make mistakes. For instance, it won't show results if you type "crechendo" instead of "crescendo". This does not make MuseScore unusable, but fuzzy search may make the live of dyslexic (and related conditions) people easier, and more generally, musical items can have somewhat complicated spelling and providing relevant items even if there is a mistake might help save people's focus / flow when they are using MuseScore.

To Reproduce Steps to reproduce the behavior:

  1. Input "crechendo" in the search field
  2. notice that crescendo is not suggested

Expected behavior

Crescendo could be suggested.

Additional context

This issue is:

wizofaus commented 1 year ago

ChatGPT integration anybody?

shoogle commented 1 month ago

As suggested by @ecstrema, the rapidfuzz-cpp library could be useful here.

It can compute a similarity ratio between strings, where a ratio score of 100% means an exact match:

// score is 96.55171966552734
double score = rapidfuzz::fuzz::ratio("this is a test", "this is a test!");

This can be used to filter a list of strings to return the ones that match the search term above a certain cutoff ratio.

ChatGPT integration anybody?

An AI assistant would be useful for many things in MuseScore, but it would be overkill for this.

raphj commented 1 month ago

Yep, and MuseScore not relying on an external service which is also proprietary is a good thing.