PHP: Add words to pspell?

722 Views Asked by At

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.

2

There are 2 best solutions below

0
On BEST ANSWER

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

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

The $dictionary_link integer is an integer representation of the pspell library handle, as returned by pspell_new or pspell_new_personal. The PHP documentation is incomplete in a lot of places regarding this variable.[1][2][3][4][5][6][7][8][9]