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

Add fuzzy name matching and mixed sources #1719

Merged
merged 11 commits into from
Mar 6, 2022
Merged

Conversation

Jguer
Copy link
Owner

@Jguer Jguer commented Mar 4, 2022

  • Add new view for -Ss and -Y
  • Make old method slightly more efficient ( double AUR sort was done before)
  • Default to new view (use yay --separatesources for old view)

Example: search of linux

image

Closes #983 (hopefully after some forth and back on metrics)

@Jguer Jguer self-assigned this Mar 4, 2022
@Jguer Jguer force-pushed the jguer/fuzzy-name-match branch from 74519b2 to 4645c12 Compare March 4, 2022 23:30
@Jguer Jguer marked this pull request as ready for review March 6, 2022 23:06
@Jguer Jguer merged commit e4a1f01 into next Mar 6, 2022
@Jguer Jguer deleted the jguer/fuzzy-name-match branch March 6, 2022 23:48
@grandchild
Copy link

Sorry for only chiming in now, but I think this could use some more work:

❯ yay -Ss python |& tail -20
community/python-sly 0.4-1 (50.2 KiB 206.7 KiB) 
    Python implementation of the lex and yacc tools
community/python-hid 1.0.4-7 (8.4 KiB 21.7 KiB) 
    Python hidapi bindings in ctypes (aka pyhidapi)
community/python-tox 3.24.5-1 (153.6 KiB 671.5 KiB) (Installed)
    Python virtualenv management and testing tool
extra/python-sip4 4.19.25-3 (77.5 KiB 250.2 KiB) 
    Python SIP4 bindings for C and C++ libraries
core/python 3.10.2-1 (11.4 MiB 53.9 MiB) (Installed)                             <== exact match at position 6
    Next generation of the python high-level scripting language
community/python-xapp 2.2.1-4 (26.8 KiB 106.3 KiB) 
    Python Xapp Library
extra/python-six 1.16.0-5 (23.2 KiB 90.6 KiB) (Installed)
    Python 2 and 3 compatibility utilities
community/python-pbr 5.8.1-1 (134.0 KiB 677.3 KiB) (Installed)
    Python Build Reasonableness
community/python-olm 3.2.10-1 (53.6 KiB 353.8 KiB) 
    Python bindings for Olm
community/python-jq 1.2.1-2 (44.8 KiB 120.1 KiB) 
    Python bindings for jq

and

❯ yay gtk

# lot's and lot's of output omitted...

    Perl bindings for GTK+ 2.x
34 extra/gtkmm-4.0 4.6.0-1 (1.3 MiB 8.6 MiB) 
    C++ bindings for GTK 4
33 community/haskell-gtk2hs-buildtools 0.13.8.0-145 (895.1 KiB 4.9 MiB) 
    Tools to build the Gtk2Hs suite of User Interface libraries.
32 aur/gtk 1.2.10-18 (+72 0.63)                                                 <== exact match at position 32
    A multi-platform toolkit (v1)
31 community/gtk-layer-shell 0.7.0-2 (69.0 KiB 358.7 KiB) 
    Library to create Wayland desktop components using the Layer Shell protocol
30 aur/gtkam 1.0-2 (+86 0.00) 
    A GTK frontend for libgphoto2
29 community/haskell-cairo 0.13.8.1-127 (436.5 KiB 3.0 MiB) 
    Binding to the cairo library for Gtk2Hs.
28 community/haskell-pango 0.13.8.1-127 (338.3 KiB 2.0 MiB) 
    Binding to the pango library for Gtk2Hs.

# more packages omitted...

6 community/gtk2+extra 3.3.4-2 (550.1 KiB 3.5 MiB) 
    GtkExtra is a useful set of widgets for creating GUI's for the Xwindows system using GTK+
5 extra/gtk-sharp-2 2.12.45-4 (3.1 MiB 6.8 MiB) 
    gtk2 bindings for C#
4 extra/gtk2 2.24.33-2 (5.9 MiB 36.3 MiB) (Installed)
    GObject-based multi-platform GUI toolkit (legacy)
3 extra/gtk3 1:3.24.33-1 (7.6 MiB 48.8 MiB) (Installed)
    GObject-based multi-platform GUI toolkit
2 extra/gtk4 1:4.6.1-3 (8.5 MiB 49.4 MiB) (Installed)
    GObject-based multi-platform GUI toolkit
1 community/gtkd 3.10.0-2 (4.5 MiB 31.5 MiB) 
    D bindings for GTK+ and related libraries.

@Jguer
Copy link
Owner Author

Jguer commented Mar 7, 2022

This for sure will need more work @grandchild , I wanted to have a working base that allowed both source display methods to coexist to make smaller additive changes.

The first example on python I have to check what caused it to be less weighted (I'm guessing description) but on the second one it definitely comes from the weight difference for AUR/sync.

Current metric is weighted:

0.6 * (name similarity) + 0.2 * (desc similarity) + 0.2 * (popularity vs official status)

popularity vs official status: something from a repo has a (popularity vs official status) = 1, for the AUR votes are taken into account.

aur packages: float64(pkg.votes) / float64(pkg.votes+60) , so a package with 500 votes has a weight of 0.89

@manticore-projects
Copy link

Greetings!

Please try to find: https://archlinux.org/packages/community/x86_64/sd/
When you find this particular package and manage to install it, the problem will be solved.

Cheers!

@Jguer
Copy link
Owner Author

Jguer commented Apr 1, 2023

image

image

The latest changes should make it nicer for exact matches

Jguer added a commit that referenced this pull request Apr 1, 2023
… to #1719 (#2043)

tweak mixed sources similarity matcher. related to #1719
@manticore-projects
Copy link

Thank you big times! I really LOVE yay (which in my opinion should be the standard packet manager), but for SD I had to resort to pacman.

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

Successfully merging this pull request may close these issues.

yay AUR exact match gets buried in list of possible package matches
3 participants