Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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



In reply to Re: Re: Re: Reverse Engineering Sort Order by BrowserUk
in thread Reverse Engineering Sort Order by qq

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 03:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found