Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: Epoman on June 26, 2006, 02:45:49 AM

Title: Is there a way to ADD words to the Spell Check?
Post by: Epoman on June 26, 2006, 02:45:49 AM
Is there ways to add words to the spell check, I run ihatedialysis.com and we use a lot of medical terminology and it get's old always having to hit ignore.

Thanks for the help.

- Epoman
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: Fizzy on June 26, 2006, 02:48:25 AM
Hi,

Look in Sources/Subs-Post.php and find


function SpellCheck()
{
global $txt, $context;

// A list of "words" we know about but pspell doesn't.
$known_words = array('smf', 'php', 'mysql', 'www', 'gif', 'jpeg', 'png', 'http', 'smfisawesome', 'grandia', 'terranigma', 'rpgs');


Just add your words to the list using the same format  :)
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: Epoman on June 26, 2006, 02:53:36 AM
Quote from: Fizzy on June 26, 2006, 02:48:25 AM
Hi,

Look in Sources/Subs-Post.php and find


function SpellCheck()
{
global $txt, $context;

// A list of "words" we know about but pspell doesn't.
$known_words = array('smf', 'php', 'mysql', 'www', 'gif', 'jpeg', 'png', 'http', 'smfisawesome', 'grandia', 'terranigma', 'rpgs');


Just add your words to the list using the same formatĀ  :)

Wow it can't be THAT easy  :o :) I'll go try right now, thank you very much.

- Epoman
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: Epoman on June 26, 2006, 03:22:43 AM
Wow that was too easy, thank you very much for the help. By the way, is there a limit of the number of words I can add?

- Epoman
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: Sol on June 26, 2006, 03:36:15 AM
There's no reason for there to be a limit. After all, it's just an array.
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: Epoman on June 26, 2006, 03:40:03 AM
Quote from: Sol on June 26, 2006, 03:36:15 AM
There's no reason for there to be a limit. After all, it's just an array.

Thanks.  ;) I'm still learning all of this stuff. You guys are great!

- Epoman
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: sawz on June 26, 2006, 07:06:34 AM
some spell checks off the option to "learn", how
can we get this in SMF.
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: Fizzy on June 26, 2006, 05:15:06 PM
Quote from: Epoman on June 26, 2006, 03:22:43 AM
Wow that was too easy, thank you very much for the help. By the way, is there a limit of the number of words I can add?

- Epoman

Hey, you're welcome :)  and no, there isn't any limit to the number of additions :)
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: 7summits on October 05, 2006, 07:45:52 AM
Hi Guys,

I tried adding words as instructed, but still they are not accepted. Furthermore the spellcheck places the proposed word at the 'replace' box, not the word it thinks is wrong (and suggest the same).

See http://7summits.com/forum
test acount: user: smftest, pw smftest
try with "Denali", or "Kili", 2 words used a lot.

Thanks for any pointers,
Cheers,
7s
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: Fizzy on October 05, 2006, 01:51:39 PM
Hi 7s

Can you please post how you added the content below the line "function SpellCheck()"
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: 7summits on October 05, 2006, 07:31:13 PM
Hi Fizzy,

here it is:
function SpellCheck()
{
global $txt, $context;

// A list of "words" we know about but pspell doesn't.
$known_words = array('smf', 'php', 'mysql', 'www', 'http', 'Everest', 'Denali', 'Kili', 'Vinson', 'McKinley', 'Elbrus', 'Kilimanjaro', 'Carstensz', 'Kosciuszko', 'Aconcagua');

loadTemplate('Post');
loadLanguage('Post');
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: Fizzy on October 06, 2006, 03:28:02 AM
Hi 7,

Can you try changing the summit names to lower case only please
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: 7summits on October 06, 2006, 04:49:04 AM
Hi, yes, changing to lowercase helps in the way that it does not question the words anymore, thanks.

So, two smaller problems remain, not sure if they can be solved:
(1) The added words are not used in the suggestion list (for example when somebody types Denaali, it will not suggest Denali in the list). Is there a way to have the added words be added to teh dictionary as well and not just ignored?

(2) Somehow the word in the 'change' box is not the word that was spelled wrong, but it is the first word in the 'suggestions' list, so you cannot see which word will be changed. Is this normal?

Thanks for any help,
best regards,
7s
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: Fizzy on October 06, 2006, 11:46:08 AM
Hi 7,

The answer to (1) is that I think you would have to get your host to add the words in to the dictionary for it to work like that. The Subs list is just a way of overlooking certain words.

The answer to (2) ... hmmm a bit trickier. I went to try and see an example using the login details you provided but unfortunately I got a template parse error.
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: 7summits on October 06, 2006, 12:58:46 PM
Hi Fizzy, the template error should be gone now, sorry for that..
Title: Re: Is there a way to ADD words to the Spell Check?
Post by: Fizzy on October 06, 2006, 01:20:52 PM
Hi 7,

Thanks for that.

If I had to hazard a guess I would say that the problem may be related to the javascript you have running on your forum or the fact that the default theme is not functioning corectly.

Can you try correcting the template errors in the default theme and see if that help correct the problem with spellcheck.