Revise handling of index and score in Inventory.suggest
#220
Labels
area: internals 🎰
function: suggest 🫴
issue: future ⏳
Planned, but not for a specific release
type: enhancement ✨
Something to add
Milestone
The current stringify-then-regex-extract approach is kind of horrifying.
I must have been on a regex kick when I wrote it.But, it was the best way I could think of at the time to retain each object'sindex
value when passed intofuzzywuzzy.process
.Should be possible to just keep everything as tuples throughout? Catch might be on trying to implement #213, since a multiprocess implementation likely won't retain the ordering of the items, and so a simple
enumerate(...)
on the (e.g.)fwp.process()
call might end up with meaningless index values.On the other hand, this sort of ugly stringified approach will probably be horrid for trying to integrate with pluggable scoring-callables (#207), and a re-implementation will be needed anyways.
Might be better to implement my own scoring based on
difflib
, move away fromfuzzywuzzy
? Or, perhaps switch to a single-string scoring function withinfuzzywuzzy
? (That switch doesn't help dealing with possible loss of ordering by multiprocessed and/or third-party scoring functions....)The text was updated successfully, but these errors were encountered: