[REBOL] Re: Hungarian Alphabet Sort (was Re: Collation sequence - proper and eff
From: gscottjones:mchsi at: 17-May-2002 13:52
From: "Carl Read"
> The new version's faster, but not
> markedly so. Perhaps 30% faster going by the single test of a long
> list of random words I did, though it's still 7 or 8 times slower than
> REBOL's sort. Maybe if it was all done with parsing it'd be faster,
> but I'd have to re-think it all. (:
>
> Anyway, here it is. See the end of the mail for how to handle
> characters that are to be considered equal. ie "A" & "a" etc.
<snip>
> Now, to give the same weight to two or more characters, enclose them
> in a block. They can either be a single string in the block, in
> which case all the characters in the string are weighted the same,
> else they can be group of strings which will all be weighted the
> same. ie...
<snip>
> Also, I've allowed for characters not included in the rules, they
> being treated as the last character in the rule. So this doesn't
> generate an error...
<snip>
> As before, no promises about how well this will perform with real
> alphabets, but it should be a bit better than the last effort.
> Hopefully. (;
By George, I think you've done it! At least it appears to sort the sample
Hungarian word list correctly. That is a slick solution. It is about 35%
faster than my original effort. Good job. I like the way you handled the
characters of equivalent weight, although I've not put this apsect through
any testing. Good job!
--Scott Jones