Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => SMF Feedback and Discussion => Topic started by: jitspoe on November 07, 2006, 05:58:11 PM

Title: Spell Check
Post by: jitspoe 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
Title: Re: Spell Check
Post by: winrules on November 07, 2006, 06:06:01 PM
SMF does use aspell. Not sure why it's not finding those words.
Title: Re: Spell Check
Post by: Compuart on November 07, 2006, 07:31:07 PM
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

Title: Re: Spell Check
Post by: jitspoe 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?
Title: Re: Spell Check
Post by: Daniel15 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:

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?
Title: Re: Spell Check
Post by: jitspoe 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".
Title: Re: Spell Check
Post by: Daniel15 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)
Title: Re: Spell Check
Post by: jitspoe 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.
Title: Re: Spell Check
Post by: Daniel15 on December 21, 2006, 05:10:25 AM
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
Title: Re: Spell Check
Post by: Lamonster 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.
Title: Re: Spell Check
Post by: 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...
Title: Re: Spell Check
Post by: Lamonster on December 26, 2006, 04:23:21 PM
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.