in reply to Re^2: In-place sort with order assignment
in thread In-place sort with order assignment

BrowserUk,
As I read through this post, a couple of my own posts popped into my head (What Is A Word? and How many words does it take?). When you say "word" and "line", do you mean englishish text? I would be pretty suprised to see a dictionary of 1+ million real words but I guess it is possible. If this process has to be repeated multiple times and if most, if not all, words from one run to the next will be seen again, then perhaps there is an even faster way of doing this (using a pre-built dictionary).

Cheers - L~R

  • Comment on Re^3: In-place sort with order assignment

Replies are listed 'Best First'.
Re^4: In-place sort with order assignment
by BrowserUk (Patriarch) on Sep 21, 2010 at 15:59 UTC

    For "words" read 'searchable terms'.

    Which would include strings of digits; proper nouns; and in a generic solution, any language.

    For testing, I'm currently using split /[^A-Za-z0-9.'+-]+/, $line; but ultimately that should be configurable.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.