Bug 442704 - Entries in glossary view should be sorted by best match
Summary: Entries in glossary view should be sorted by best match
Status: REPORTED
Alias: None
Product: lokalize
Classification: Applications
Component: glossary (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Simon Depiets
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-19 16:30 UTC by Karl Ove Hufthammer
Modified: 2021-09-19 16:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Glossary view in Lokalize (210.95 KB, image/png)
2021-09-19 16:30 UTC, Karl Ove Hufthammer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Ove Hufthammer 2021-09-19 16:30:16 UTC
Created attachment 141706 [details]
Glossary view in Lokalize

SUMMARY
The sort order of the glossary entries seems more or less random. It would be better if the best matches (e.g. longest exact word match) were shown first.

For an example, see the attached screen shot. The original string is:

  &Edit File Type...

The glossary suggestions are (in this order):

  profile | edit profile | edit file | edit | profiling | editing | file type | file | edit profiles

I would expect the longest (counting words, not characters) exact match to be displayed first, and entries based on stemming to be displayed last, e.g.:

  edit file | file type | edit | file | edit profile | edit profiles | profile | profiling | editing


STEPS TO REPRODUCE
1. Open a project which uses a glossary file. My example was based on this glossary file: https://huftis.org/kritikk/termbase/nn.tbx
2. Open a PO file that has a string with several matches. My example was based on https://websvn.kde.org/trunk/l10n-support/nn/summit/messages/dolphin/dolphin.po?revision=1608940&view=markup
3. Look at the order of the glossary entries.

OBSERVED RESULT
The order of the glossary entries seems more or less random. (See attached screenshot.)

EXPECTED RESULT
The best glossary matches should be displayed first.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20210915
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2
Kernel Version: 5.14.2-1-default (64-bit)
Graphics Platform: X11