You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be cool to have a slash command for searching sphinx documentation. All sphinx docs generate an object.inv file, which can be downloaded, parsed, and cached.
I found some great documentation on how to parse this https://sphobjinv.readthedocs.io/en/latest/syntax.html. Once parsed, it can be cached, and then we can probably use some sort of fuzzy search. The cached version of documentation can be set to expire after 24 hours.
For the slash command, I was thinking something like this:
The docs-url can have autocomplete (and we can list more common projects), but will let you specify any valid sphinx url. If the url hasn't been used yet, it'll download/parse/cache it first.
This seems useful to me.
I'd like to integrate a fuzzy search algorithm for this (and for peps). I think thats the place to finally oxidize mcoding bot
LETS FUCKING GO
Fyi there are fuzzy search dependencies in c but I want to oxidize cause it's fun. Should be done in a way you don't need rustc to contribute though.
Also parsing rst isn't a bad place to use rust imo.
Sphinx parses the docstrings and creates an objects.inv file. That's what I need to parse. I suppose it could be written in rust, but I'm going to figure it out in python first and then we can RIR if we want.
Fyi there are fuzzy search dependencies in c but I want to oxidize cause it's fun.
Sounds good to me, as long as mCodingBot can use the library without doing anything with rustc.
Author of sphobjinv here. Glad you found the explainer on the objects.inv syntax useful!
Depending on exactly what you need to do, sphobjinv includes fuzzy-search capabilities that might be enough for you. In the current v2.3.1 it uses a vendored copy of [fuzzywuzzy].
Check out the Inventory.suggest() method -- it won't be nearly as fast as it would be in Rust (though I hopefully will have time to explore increasing performance before too long...), but it's already implemented.
@bskinn we already have a utility for fuzzy searching that uses RapidFuzz. I think it's good enough, but I don't know how it compares to what you're suggesting.
That's probably already better than what sphobjinv would offer, then. 👍 At this point I would only recommend sphobjinv as a quick path from nothing to something.
I have a grand plan to implement a plugin system for sphobjinv someday (bskinn/sphobjinv#207), which would allow wiring in custom scorers for suggest. That's likely a long way off, though... and would be overkill if the default fuzz scoring works fine for you.
Activity
zunda-arrow commentedon Sep 13, 2022
This seems useful to me.
I'd like to integrate a fuzzy search algorithm for this (and for peps). I think thats the place to finally oxidize mcoding bot
circuitsacul commentedon Sep 13, 2022
I was thinking the same thing.
rust-fuzzysearchtime?zunda-arrow commentedon Sep 13, 2022
LETS FUCKING GO
Fyi there are fuzzy search dependencies in c but I want to oxidize cause it's fun. Should be done in a way you don't need rustc to contribute though.
Also parsing rst isn't a bad place to use rust imo.
circuitsacul commentedon Sep 13, 2022
Where are we parsing rst?
zunda-arrow commentedon Sep 13, 2022
I thought we needed to to get doc information. (If we make a RTFM command in this issue)
circuitsacul commentedon Sep 13, 2022
Sphinx parses the docstrings and creates an objects.inv file. That's what I need to parse. I suppose it could be written in rust, but I'm going to figure it out in python first and then we can RIR if we want.
Sounds good to me, as long as mCodingBot can use the library without doing anything with rustc.
circuitsacul commentedon Sep 13, 2022
https://github.com/maxbachmann/RapidFuzz
Enderchief commentedon Dec 6, 2022
assign this to me
:ball:
Enderchief commentedon Dec 6, 2022
unassign this to me
not ball
bskinn commentedon Aug 25, 2023
Author of
sphobjinvhere. Glad you found the explainer on theobjects.invsyntax useful!Depending on exactly what you need to do,
sphobjinvincludes fuzzy-search capabilities that might be enough for you. In the current v2.3.1 it uses a vendored copy of [fuzzywuzzy].Check out the
Inventory.suggest()method -- it won't be nearly as fast as it would be in Rust (though I hopefully will have time to explore increasing performance before too long...), but it's already implemented.circuitsacul commentedon Aug 25, 2023
@bskinn we already have a utility for fuzzy searching that uses RapidFuzz. I think it's good enough, but I don't know how it compares to what you're suggesting.
Edit: code is here: https://github.com/mcb-dev/mCodingBot/blob/main/mcodingbot/utils/search.py
bskinn commentedon Aug 25, 2023
That's probably already better than what
sphobjinvwould offer, then. 👍 At this point I would only recommendsphobjinvas a quick path from nothing to something.I have a grand plan to implement a plugin system for
sphobjinvsomeday (bskinn/sphobjinv#207), which would allow wiring in custom scorers forsuggest. That's likely a long way off, though... and would be overkill if the default fuzz scoring works fine for you.