Advertisement:

Author Topic: Spell Check  (Read 7273 times)

Offline jitspoe

  • Jr. Member
  • **
  • Posts: 170
Spell Check
« on: November 07, 2006, 05:58:11 PM »
Spellling, permanate, and several other misspelled words get passed by the spell checker on every SMF forum I've seen.  Doesn't SMF use aspell?  Does everybody just have outdated aspell libraries?

I googled around and found this php spellcheck script which does not seem to have the same problem: http://chxo.com/scripts/spellcheck.php

Offline winrules

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,085
  • Gender: Male
Re: Spell Check
« Reply #1 on: November 07, 2006, 06:06:01 PM »
SMF does use aspell. Not sure why it's not finding those words.
winrules
SMF Developer
               My Mods
Please do not PM me for support.


Offline Compuart

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,774
  • Gender: Male
  • ZĂ©eeeal
    • RealityNet
Re: Spell Check
« Reply #2 on: November 07, 2006, 07:31:07 PM »
Not sure why, but it's definitely something with aspell. I've tried this code:

Code: [Select]
<?php

$pspell_link 
pspell_new('en''american''''UTF-8'PSPELL_FAST PSPELL_RUN_TOGETHER);
$tests = array(
'spel',
'spell',
'spelll',
'speling',
'spelling',
'spellling',
);

foreach (
$tests as $test)
echo $test'->'pspell_check($pspell_link$test) ? 'correct' 'incorrect''<br />';

?>

and it produced the following output:
Code: [Select]
spel->incorrect
spell->correct
spelll->incorrect
speling->incorrect
spelling->correct
spellling->correct
Hendrik Jan Visser
Former Lead Developer & Co-founder www.simplemachines.org
Personal Signature:
Realitynet.nl -> ExpeditieRobinson.net / PekingExpress.org / WieIsDeMol.Com

Offline jitspoe

  • Jr. Member
  • **
  • Posts: 170
Re: Spell Check
« Reply #3 on: November 09, 2006, 09:07:15 PM »
I made a bug report on the aspell site, but the developer said it was just an old version of aspell and that it had been fixed.  I guess it's standard practice to have ancient versions of aspell on web servers?  Or maybe php points to the wrong one by default?

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,222
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Spell Check
« Reply #4 on: November 19, 2006, 05:40:23 AM »
I think this has something to do with PHP's pspell functions. Running the script posted above:
Code: [Select]
spel->incorrect
spell->correct
spelll->incorrect
speling->incorrect
spelling->correct
spellling->correct

So, it marks spellling as correct. However, running aspell from a SSH prompt:
Code: [Select]
root@server1:/home/daniel# cat test_words
spel
spell
spelll
speling
spelling
spellling

root@server1:/home/daniel# cat test_words | aspell list
spel
spelll
speling
spellling
root@server1:/home/daniel# aspell -v
@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.4)
Running it from a shell prompt shows the correct results (spellling is wrong). I guess it's the way PHP uses aspell?
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline jitspoe

  • Jr. Member
  • **
  • Posts: 170
Re: Spell Check
« Reply #5 on: November 28, 2006, 04:01:48 PM »
Does php use aspell or pspell?  I've noticed a few other weird words spell check doesn't correct, like "outdune".

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,222
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Spell Check
« Reply #6 on: November 28, 2006, 08:13:25 PM »
That's the confusing bit. PHP has two libraries, aspell and pspell. The aspell library is an OLD version of aspell, and the pspell library is what's used currently (which also uses aspell, via a backwards-compatibility interface)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline jitspoe

  • Jr. Member
  • **
  • Posts: 170
Re: Spell Check
« Reply #7 on: December 21, 2006, 04:39:32 AM »
It seems any word, if it uses a combination of correctly spelled words, passes the spell check.  For example, "donkeyspitmonkeypoopflingingelephant" passes the spell check.  It only works for words past a certain length (4 letters?).  "on" and "line" both pass the spell check, however, "online" does not pass the spell check.

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,222
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Spell Check
« Reply #8 on: December 21, 2006, 05:10:25 AM »
Quote
For example, "donkeyspitmonkeypoopflingingelephant" passes the spell check.
That's an... interesting word :P
I guess this is a PHP bug, and hence it should be reported to the PHP developers?
OK, I reported it myself, even though I'm not quite sure if it's really a PHP bug, or a pspell/aspell bug... See http://bugs.php.net/39921
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Lamonster

  • Semi-Newbie
  • *
  • Posts: 28
Re: Spell Check
« Reply #9 on: December 25, 2006, 09:59:07 AM »
I use www.iespell.com on a lot of other forums that don't have a spell checker and it will find words that are miss spelled that SMF won't find, no big deal. One thing I would like to see is a "add" button for words that are not spelled wrong but are just not in the dictionary.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 59,520
  • Gender: Male
    • Kindred-999 on GitHub
Re: Spell Check
« Reply #10 on: December 25, 2006, 10:36:31 AM »
ther eis alreayd a mod add-on for SMF to add custom words into the dictionary.

look at the custom dictionary words mod, by Jay...
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Offline Lamonster

  • Semi-Newbie
  • *
  • Posts: 28
Re: Spell Check
« Reply #11 on: December 26, 2006, 04:23:21 PM »
ther eis alreayd a mod add-on for SMF to add custom words into the dictionary.

look at the custom dictionary words mod, by Jay...


Thanks Jay, I didn't know that.