Search code examples
phpspell-checkingpspell

PHP: Add words to pspell?


I am using pspell like this:

$ps = pspell_new("en");
if(!pspell_check($ps, $word))
{
    $suggestion = pspell_suggest($ps, $word);   
}

However I want to added some industry terms to the list.

I looked up pspell_add_to_session which says the first param is supposed to be int $dictionary_link But I do not know what that is and there is no example.


Solution

  • In your case, the $ps variable created by pspell_new() is that "dictionary link":

    $ps = pspell_new("en");
    pspell_add_to_session($ps, "somenewword");