News:

Wondering if this will always be free?  See why free is better.

Main Menu

Is there a way to ADD words to the Spell Check?

Started by Epoman, June 26, 2006, 02:45:49 AM

Previous topic - Next topic

Epoman

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

Fizzy

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  :)
"Reality is merely an illusion, albeit a very persistent one." - A.E.


Epoman

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

Epoman

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

Sol

There's no reason for there to be a limit. After all, it's just an array.

Epoman

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

sawz

some spell checks off the option to "learn", how
can we get this in SMF.
keep smiling, they'll always wonder what your up too.....

Fizzy

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 :)
"Reality is merely an illusion, albeit a very persistent one." - A.E.


7summits

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
Check out the modded http://7summits.com/forum for info about climbing the highest mountains on the 7 continents on earth!    Send my avatar as an ecard here :-)

Fizzy

Hi 7s

Can you please post how you added the content below the line "function SpellCheck()"
"Reality is merely an illusion, albeit a very persistent one." - A.E.


7summits

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');
Check out the modded http://7summits.com/forum for info about climbing the highest mountains on the 7 continents on earth!    Send my avatar as an ecard here :-)

Fizzy

Hi 7,

Can you try changing the summit names to lower case only please
"Reality is merely an illusion, albeit a very persistent one." - A.E.


7summits

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
Check out the modded http://7summits.com/forum for info about climbing the highest mountains on the 7 continents on earth!    Send my avatar as an ecard here :-)

Fizzy

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.
"Reality is merely an illusion, albeit a very persistent one." - A.E.


7summits

Hi Fizzy, the template error should be gone now, sorry for that..
Check out the modded http://7summits.com/forum for info about climbing the highest mountains on the 7 continents on earth!    Send my avatar as an ecard here :-)

Fizzy

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.
"Reality is merely an illusion, albeit a very persistent one." - A.E.


Advertisement: