Bad Spelling

I had a great idea in the shower this morning.

As you may or may not know, Windows servers don't have access (please correct me if I'm wrong) to the aspell spelling resources of PHP that Linux servers do. As a result, many of the spell-checkers that one might install for WordPress just won't work on Windows.

Here's my idea: Create aplugin that exposes an XMLRPC method for spelling. The method would accept an array of unique words and return an array of misspelled words, each with an array of suggested replacements.When you "Save and Continue Editing" a post, the plugin would route the preview (you know, that text under the editing box) through the "the_content" filter. This particular filter plugin would only be active in the admin console.

The text would be exploded and uniqued, then sent to the XMLRPC procedure for processing. (The XMLRPC thing could be skipped on servers that have a working aspell.) The plugin would then replace misspelled words the content with a specially styled and crafted

div

tag.

The div tag would contain the bad word plus a tag hidden via CSS that contains the replacements and a word of context from either side of the bad word. The div would allow the word to appear with a red underline, and when you click on one of these words, script would pop-up the replacement candidates.

When you choose a replacement, the script would use the context words to located that exact word in the post text edit box, and replace it with the chosen replacement.

Easy as pie.

Ok, it sounds difficult, but I already wrote this in Delphi for my custom CMS a while ago, so I cna't imagine it's too hard.

On the administrative side, an options page could allow you to accept spelling XMLRPC requests only from certain servers. So all you need to do if you don't have aspell is to ask your blogging friend to borrow their speller plugin, and they activate you in their options.

Of course, I could try to integrate something like spellchecker.net, but that's $150 per year. That's crazy.

Alternatives would be nice. Something that would highlight poor spelling inside the post editing textbox would be awesome.


9 Responses to Bad Spelling

  1. valerie from spoken-for.org 2005-02-17 18:26:58

    A spell checker would be nice - I couldn't get that method to work on mine either, even with Linux. It said it didn't exist.

  2. Owen from www.asymptomatic.net 2005-02-17 18:48:14

    Back in the day when I had a Linux box I had to install it myself. It was a pain in the butt. I wonder if Netrillium has it. If so, I think I know where my XMLRPC calls will be headed toward. The net effect is I'll be paying, what, $24 per year for spell checking?

    And with my plan, I'll be able to share. :)

  3. valerie from spoken-for.org 2005-02-17 19:09:00

    Ah, well, I never tried it on Netrillium, only this new Site5 server. :-D
    As of tomorrow, my Netrillium account is hereby closed. Good-bye, Netrillium, I will miss you...

  4. Phunky from phunky.co.uk 2005-02-18 01:55:15

    I may be able to get hold of a large wordlist if you want? Got it off a large ASP.NET spell checker app

  5. Nathan Nutter from enduringvoices.com 2005-02-20 15:26:20

    What is wrong with ColdForged's Spell Checker?

  6. Owen from www.asymptomatic.net 2005-02-20 16:01:58

    Nothing is wrong with it. Really, it's rather nice.

    But that's only if you have aspell installed and working properly on your server. If your host won't or can't install it, you're out of luck.

  7. Nathan Nutter from enduringvoices.com 2005-02-21 15:54:53

    My bad, I did not realize it used aspell.

    Of course if you use Firefox/Mozilla you can get SpellBound and if you use Safari you can use the builtin spellchecker.

    I wonder if anyone has looked at the Google spellchecker, maybe someone could access it and just write a front-end for WordPress.

  8. Pat 2005-02-22 14:35:12

    I should warn you that I'm pretty sure Microsoft has a patent on the squiggly-underline realtime-spellchecking stuff. You may want to investigate/go a different route.

    Were I you, I'd make sure to only offer such spelling to posters, not commenters, or at least put restrictions in on what will be spell-checked. I'd imagine that this would be somewhat of a resource hog (at least, if it had good spelling correction suggestions), and you don't want your server to get bogged down by random people. Were I malicious, I would be constantly spell-checking stuff and the like, to DOS your machine. Always design-in security. :)

  9. For Want of a Grease Pencil - Asymptomatic from asymptomatic.net 2008-05-25 17:37:22

    ...y that I paradoxically - since the walls are plain white and small - have a lot of good ideas while in the shower. I had another one of those days today. I must have come up with three or four solid ideas about th...

1362