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
Works well with structured data that is similar, but the following arbitrary strings cause a failure:
For example
arr = [ "99-101 some street address", "Some other thing", "1"]
Naturally.sort(arr)
results in ArgumentError: comparison of Array with Array failed, In this case ruby doesn't consider the arrays produced by Naturally.normalize to comparable.
The text was updated successfully, but these errors were encountered:
Works well with structured data that is similar, but the following
arbitrary strings cause a failure:
For example
arr = [ "99-101 some street address", "Some other thing", "1"]
Naturally.sort(arr)
results in ArgumentError: comparison of Array with Array failed, In this
case ruby doesn't consider the arrays produced by Naturally.normalize to
comparable.
—
Reply to this email directly or view it on GitHub #21.
I don't have a solid opinion in regards to what I would expect. At a pinch I'd be happy with:
"1", "99-101 some street address", "Some other thing"
but I'm assuming numbers before letters and I can see others having (valid) opinions that it should be the other way around. The main point is that it shouldn't stack trace out when sorting strings regardless of whether the normalize method tokenizes the strings differently.
The main point is that it shouldn't stack trace out...
Ah hah, I agree with you there. I think better behavior would be for #sort to raise a more meaningful "Can't sort this" exception. And then we could have a new method like #sort_always which would never raise an exception. Instead it'd do a simple Array#sort.
Works well with structured data that is similar, but the following arbitrary strings cause a failure:
For example
arr = [ "99-101 some street address", "Some other thing", "1"]
Naturally.sort(arr)
results in ArgumentError: comparison of Array with Array failed, In this case ruby doesn't consider the arrays produced by Naturally.normalize to comparable.
The text was updated successfully, but these errors were encountered: