I am trying to create a custom master dictionary of words that I can access using the pspell functions in php. Basically I am trying to add a spell check to a search page similar to what google does.
I can't simply add a personal dictionary to my main dictionary because it returns too many suggestions for my application. I need to create a subset of specific english words for my custom dictionary. I was told the way to go about this is to create a new language file and word list.
I have successfully created a new language file and word list and I can use it to do spell checking from the command line just fine.
The problem is I can't get PHP to open the new dictionary.
I am using:
$pspell_link = pspell_new("custom_language", "", "", "", PSPELL_FAST);
PHP either opens up the default english dictionary or opens nothing at all and returns this error:
Warning: PSPELL couldn't open the dictionary. reason: I'm sorry I can't find any suitable word lists for the language-tag "custom_language".
I noticed in the PHP documentation for pspell_new, the language code is supposed to be a 2 letter string. Do the PHP pspell functions only work with standard pre-defined languages?
Any ideas here?
Has anyone accessed a custom dictionary using PHP like this?