August 2003
Intermediate to advanced
1104 pages
19h 27m
English
PHP offers spell checking through the Pspell library, which is a replacement for the older Aspell library.
The pspell_add_to_personal function (Listing 12.73) adds a word to a personal dictionary. You must supply a configuration link as created by pspell_new_config.
<?php
//create a configuration link
$config = pspell_config_create("en");
//set path to personal words
pspell_config_personal($config, "/tmp/custom.pws");
//load dictionary
$new_config = pspell_new_config($config);
//add word to dictionary
pspell_add_to_personal($new_config, "Leon");
//save personal dictionary
pspell_save_wordlist($new_config);
?>
|
Read now
Unlock full access