• Welcome to Simple Machines Community Forum. Please login or sign up.
September 16, 2021, 06:06:29 PM

News:

SMF 2.0.18 has been released! Please update. Read more.


Spell Check

Started by jitspoe, November 07, 2006, 05:58:11 PM

Previous topic - Next topic

jitspoe

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

winrules

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.


Compuart

Not sure why, but it's definitely something with aspell. I've tried this code:

<?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:
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

jitspoe

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?

Daniel15

I think this has something to do with PHP's pspell functions. Running the script posted above:

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:

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!

jitspoe

Does php use aspell or pspell?  I've noticed a few other weird words spell check doesn't correct, like "outdune".

Daniel15

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!

jitspoe

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.

Daniel15

QuoteFor 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!

Lamonster

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.

Kindred

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."

Lamonster

Quote from: Kindred 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...


Thanks Jay, I didn't know that.

Advertisement: