archlinuxfr / package-query

Query alpm database and AUR
69 stars 17 forks source link

Improve relevance sorting by calculating LCS for package names #118

Closed f2404 closed 8 years ago

f2404 commented 8 years ago

This attempts to resolve #117 by calculating LCS between the target and the result name in case when the packages are searched by both names and descriptions (this is not needed when searching by names only).

The output may still be improved - "yaourt-gui-manjaro" could be on a higher position since it contains full target string. This is a subject for further research.

$ ./src/package-query -As yaourt --sort r
aur/yaourt 1.8.1-1 (2850) (55.06)
    A pacman wrapper with extended features and AUR support
aur/yaourt-git 1.8.1.r11.g153c1f3-1 [installed] (182) (5.93)
    A pacman wrapper with extended features and AUR support
aur/yaourt-gui 1.5-2 (201) (5.73)
    A bash GUI for yaourt
aur/aurtab 1-2 (12) (1.52)
    AUR tab completion for yaourt and apacman using zsh.
aur/safeaur 1.1.2-1 (2) (1.06)
    safeaur is auto Backup and re-store System for yaourt.
aur/yaourt-gui-manjaro 1.4.5-2 (16) (0.69)
    A bash GUI for yaourt (Manjaro theming) and Romanian translation added
aur/pacmind 2.5-4 (54) (1.07)
    A gtkdialog frontend gui for the package manager, inspired to yaourt-gui
aur/lightspark-local 20120810-1 (0) (0.00)
    My modified version of the lightspark-git PKGBUILD; Enhancements: choose between devel and normal buildtype, save 
    changes local even if you use yaourt
aur/pacmanxg 4.17.0-1 (7) (0.87)
    Yet another GUI for pacman and yaourt. Depends on neither GTK or Qt: only X11
aur/pac_manage 1.4-1 (0) (0.00)
    pacman/yaourt helper - manage packages in a single file