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 supp开发者_运维问答osed to be int $dictionary_link
But I do not know what that is and there is no example.
In your case, the $ps
variable created by pspell_new()
is that "dictionary link":
$ps = pspell_new("en");
pspell_add_to_session($ps, "somenewword");
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]
精彩评论