#142 textfx case insensitive sort comes out unorderred withint groups

Next release
open
nobody
None
5
2014-03-14
2014-03-14
No

textfx case insensitive sort comes out with the problem that for a given starting letter such as A, all other letters are unordered. it should order the case insensitive results within a group in ASCII or UNICODE order.

ABCD
abc
def
Abc
aBcd
ABC

sometimes comes out like

abc
Abc
aBcd
ABCD
ABC
def

in the ascii and UNICODE character set, a comes after A.

Abc and abc I see abc before Abc, and this is not preferable.

desired result would be

ABC
ABCD
Abc
aBcd
abc
def

I would have to think for a while to figure out how to do this. it needs to be case insensitive, yet partially case sensitive. I don't know how to describe this in detail.

perhaps the solution problem is, that when you compare the min of the lengths of the strings (for a given group?) and/or they all contain the same length and same characters case insensitively (this could be defined as a group), then that sub-group should be sorted case sensitvely. groups may not be very long.

priority on comparison should be that for case insensitive (which may solve some of the problems), something like this, which you can use with the <algorithm>::sort().

bool sortcompareab(a,b) {
if (a.toLower()<b.toLower()) {
    return true;
} else if (0==a.tolower().compare(b.tolower() && a<b) {
    return true;
} else {
   return false
}

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks