开发者

PHP: Add words to pspell?

开发者 https://www.devze.com 2023-01-07 08:42 出处:网络
I am using pspell like this: $ps = pspell_new(\"en\"); if(!pspell_check($ps, $word)) { $suggestion = pspell_suggest($ps, $word);

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]

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号