Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Re: Reverse Engineering Sort Order

by BrowserUk (Patriarch)
on Jun 10, 2003 at 18:27 UTC ( [id://264814]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Reverse Engineering Sort Order
in thread Reverse Engineering Sort Order

I think the problem was more mine than yours. zby managed to work out what you were asking, as evidenced by

Perhaps he want's an algorithm that given the sorted list would output the definition of the sorting function.

But no matter how many times I read it, I didn't get your drift.

However, since then I have given the problem some pretty serious thunking, and I'm really not sure that what your asking is possible. Leastwise, not if your after complete accuracy unless you have a very large sample set that reflects all the possible comparisons. Even then, there is another, trickier problem.

Lets assume somewhere in your dataset you had

cuerno chile

According to the POD for Sort::ArbBiLex, in a spanish dictionary, cuerno sorts before chile, because the 'ch' in chile, is considered a "single glyph" that sorts after the single glyph 'c' in cuerno.

The problem is, whos to says that there isn't a language where the second glyph in cuerno is 'ue', and that this is designated as sorting before the second glyph in chile, 'h'?

I simply cannot see any mechanistic way of making the determination of when 2 character codes represent a single glyph. It strikes me that the only way to do this is heuristically, and that means that you would have to already know what pairs consituted single glyphs up front.

I don't envy you the problem, but if you do solve it, I'd be very interested to see how you do it.

Good luck:)


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller


Replies are listed 'Best First'.
Re: Re: Re: Re: Reverse Engineering Sort Order
by qq (Hermit) on Jun 10, 2003 at 19:11 UTC

    I agree. In my original post I mention that the first step would be to get a list of glyphs, which would probably require manual intervention. (Although not in the simple case where all multi-character glyphs are escaped)

    But even if the glyphs are known I can't see how to go forward.

    I'm also not necessarily trying for a perfect solution.

    btw, I take to heart youre less is more comment. I think the problem could have been much more clearly presented, and I will try to do so in the future.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://264814]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-19 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found