BrowserUk appears to have this covered on technical grounds, but I also wanted to note: I'm not trying to re-invent the spell checker. If counting typos was all I wanted to do then your idea would certainly get the job done. But, as my post says, I want to spell check individual words during a lot of other processing.

If you must know, I have a million books digitally scanned by the Open Library, and a lot of these books are really old and the character recognition isn't good enough to make the result even slightly useful. I'm running a boat load of stuff on this big corpus (one time preprocessing as well as, later, as-needed lookups) so I wanted to chuck out entirely those books that are so garbled as to be meaningless, to save time and space. So, while I process them I spell check them, and if the number of spelling errors per line reaches a certain threshold after a certain number of lines, I discard the book.

I had forgotten aspell, though, so I did give it a go. However, unless I'm missing something, I need to do a bit of parsing in order to understand the response aspell gives. In addition, I'll have start a separate instance of aspell for every sentence, and there are literally billions of sentences, so that would be some overhead.

If you do have any ideas, however, about how I could extract the abovementioned process into something in which I could run aspell over a single file to get my results, I'd be interested to hear it.


In reply to Re^3: Advice for optimizing lookup speed in gigantic hashes by tobek
in thread Advice for optimizing lookup speed in gigantic hashes by tobek

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.