Open will-molloy opened 1 year ago
Also a problem with (2) is you may want to preprocess the dataset but not the users input.
So you may have to go with 1 which has unnecessary hashset filter (really bad with large dataset).
@will-molloy If it's still actual, you can use my fork where I implemented such method https://www.nuget.org/packages/Raffinert.FuzzySharp
I also created a PR to this repository.
Currently the
Process.Extract...
methods have 2 signatures:1:
string query, IEnumerable<string> choices
:and 2:
T query, IEnumerable<T> choices
:In my case the user enters a
string
to filter aList<T>
of objects.I can use 1 if I convert to
string
first, collect the results toHashSet<string>
, and use that to filter the originalList<T>
:Or 2 if I create a dummy
T query
object from the string entered by the user:The 2nd one isn't that bad... but tbh I struggle to think of a case where you would have a
T query
? Especially since theFunc<T, string> processor
is required for this overload.So I think a signature like this would be useful:
To be used like: