Humanizer
Humanizer copied to clipboard
Humanize string comparisons
Sorting things the way humans expect:
Unsorted data:
Item 6
Item 2
Item 10
Using standard string comparison ordering you get:
Item 10
Item 4
Item 6
My users expect:
Item 4
Item 6
Item 10
I've got some code that handles the use cases I encounter. I could contribute as a starting point.
I like the idea! I found a few dedicated libraries that do this:
- natural-sort on GitHub (Apache-2.0 License)
- NaturalStringComparer on GitHub (MIT License)
- Thomas Levesque on StackOverflow (cc by-sa)
Does it make sense to integrate one of those approaches into Humanizer or would it be "good enough" to know that implementations exist, in your opinion?