Advertisement:

Author Topic: Is there a way to ADD words to the Spell Check?  (Read 11112 times)

Offline Epoman

  • Semi-Newbie
  • *
  • Posts: 51
Is there a way to ADD words to the Spell Check?
« 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
« Last Edit: June 26, 2006, 04:49:58 AM by Amacythe »

Offline Fizzy

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,676
  • Gender: Male
  • SMF World Domination
Re: Is there a way to ADD words to the Spell Check?
« Reply #1 on: June 26, 2006, 02:48:25 AM »
Hi,

Look in Sources/Subs-Post.php and find

Code: [Select]
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.


Offline Epoman

  • Semi-Newbie
  • *
  • Posts: 51
Re: Is there a way to ADD words to the Spell Check?
« Reply #2 on: June 26, 2006, 02:53:36 AM »
Hi,

Look in Sources/Subs-Post.php and find

Code: [Select]
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

Offline Epoman

  • Semi-Newbie
  • *
  • Posts: 51
Re: Is there a way to ADD words to the Spell Check?
« Reply #3 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

Offline Sol

  • Jr. Member
  • **
  • Posts: 125
    • Frider Wave Studios
Re: Is there a way to ADD words to the Spell Check?
« Reply #4 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.

Offline Epoman

  • Semi-Newbie
  • *
  • Posts: 51
Re: Is there a way to ADD words to the Spell Check?
« Reply #5 on: June 26, 2006, 03:40:03 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

Offline sawz

  • SMF Hero
  • ******
  • Posts: 3,360
  • Gender: Male
  • i'm....controversial
    • paid directory project
Re: Is there a way to ADD words to the Spell Check?
« Reply #6 on: June 26, 2006, 07:06:34 AM »
some spell checks off the option to "learn", how
can we get this in SMF.

Offline Fizzy

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,676
  • Gender: Male
  • SMF World Domination
Re: Is there a way to ADD words to the Spell Check?
« Reply #7 on: June 26, 2006, 05:15:06 PM »
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.


Offline 7summits

  • Jr. Member
  • **
  • Posts: 118
  • Gender: Male
  • My personal text would like to stay that way
    • 7summits.com the highest mountains per continent!
Re: Is there a way to ADD words to the Spell Check?
« Reply #8 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
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 :-)

Offline Fizzy

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,676
  • Gender: Male
  • SMF World Domination
Re: Is there a way to ADD words to the Spell Check?
« Reply #9 on: October 05, 2006, 01:51:39 PM »
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.


Offline 7summits

  • Jr. Member
  • **
  • Posts: 118
  • Gender: Male
  • My personal text would like to stay that way
    • 7summits.com the highest mountains per continent!
Re: Is there a way to ADD words to the Spell Check?
« Reply #10 on: October 05, 2006, 07:31:13 PM »
Hi Fizzy,

here it is:
Code: [Select]
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 :-)

Offline Fizzy

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,676
  • Gender: Male
  • SMF World Domination
Re: Is there a way to ADD words to the Spell Check?
« Reply #11 on: October 06, 2006, 03:28:02 AM »
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.


Offline 7summits

  • Jr. Member
  • **
  • Posts: 118
  • Gender: Male
  • My personal text would like to stay that way
    • 7summits.com the highest mountains per continent!
Re: Is there a way to ADD words to the Spell Check?
« Reply #12 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
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 :-)

Offline Fizzy

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,676
  • Gender: Male
  • SMF World Domination
Re: Is there a way to ADD words to the Spell Check?
« Reply #13 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.
"Reality is merely an illusion, albeit a very persistent one." - A.E.


Offline 7summits

  • Jr. Member
  • **
  • Posts: 118
  • Gender: Male
  • My personal text would like to stay that way
    • 7summits.com the highest mountains per continent!
Re: Is there a way to ADD words to the Spell Check?
« Reply #14 on: October 06, 2006, 12:58:46 PM »
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 :-)

Offline Fizzy

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,676
  • Gender: Male
  • SMF World Domination
Re: Is there a way to ADD words to the Spell Check?
« Reply #15 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.
"Reality is merely an illusion, albeit a very persistent one." - A.E.