Announcement

Collapse
No announcement yet.

Spell Checking

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spell Checking

    I want to incorporate a spell checker into my site and so I have been looking through my PHP book, and I came across a function in the appendix called pspell_check(). It is used for spell checking, but I am not sure how I would do this. First of all, do you need some special dictionary file to use this? How would I use PHP and/or javascript as sort of an online spell checker (kinda like MS word style)? Thanks for any help!

  • #2
    doing something like what word does would be rather tricky...this is what I do on one of my news scripts.

    Firstly, you have to have pspell enabled in your php configs AND have the pspell libraries. [more...]


    When users submit a post and there is an error (spelling wise), it automatically throws them back into preview post mode. I check the spelling by using pspell_check() and looping though all the words in the post. In the preview they can then hover over words that are marked with red unline (I simply replace "text" with "<font color=red>text</font>" if the spelling is incorrect) and a little hover-box over the mouse appears with suggestions as to the right spelling (done using pspell_suggest() and a little java mouse-over script, you can find them everywhere.) Once they are happy that they have corrected their spelling mistakes they can proceed to post.

    What my script CANT do is let people click on the suggestion that they think is right and then the script automatically correct it. I don't have the time to stuff around and get this working. IMHO ive done enough to let people know if something is spelt incorrectly, I'm not going to spend hours trying to code stuff to make up for their lazyness as well
    Last edited by Conscience; Mon 13 May '02, 9:38pm.
    Cons

    Comment


    • #3
      Thanks for the help! This can really help me. But, at the PHP site, it says you need to compile PHP with the pspell option. Is there a way to enable this without recompiling PHP?!

      Comment


      • #4
        Originally posted by Gamefreak
        Thanks for the help! This can really help me. But, at the PHP site, it says you need to compile PHP with the pspell option. Is there a way to enable this without recompiling PHP?!
        Yes and No. Whilst it is technicallly possible to compile pspell as php module on a standalone basis. In reality it is far simpler to recompile php.

        Comment


        • #5
          yeah, that is what I was refering to in the config thing. and the previous user is right... the easiest way is to recompile php...this usually means a recompile of apache too, depending on your setup
          Cons

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X