Closed thornycrackers closed 6 years ago
That's easy to implement. I'll start working on it. What do you say, @amjith ?
@thornycrackers This is a bit more subtle. We will have to reorder the list based on the best match. The best match is computed by choosing the smallest contiguous match, followed by where the match is found in the full string, followed by the alphanumeric sorting.
So even if we remove the alphanumeric sorting (or make it optional) that does not guarantee that the order will be preserved.
@gokulsoumya I do see value in making the alphanumeric sorting optional, so if you're interested in implementing it, I say go for it. Make it an optional argument with the default value set to preserve the current behavior.
First off, this is an amazing library! Thanks so much for this. One thing I am finding is duplicating my code a bit though is if I run the following code
The
list(suggestions)
code comes back as['abaa', 'dbaa', 'zbaa']
. When I'm passing my original list it's already sorted so I end up having to resort it again after I'm done. Is there anyway to disable this so that it gives the order that the list was presented in?