Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pspell_store_replacement(3) [php man page]

PSPELL_STORE_REPLACEMENT(3)						 1					       PSPELL_STORE_REPLACEMENT(3)

pspell_store_replacement - Store a replacement pair for a word

SYNOPSIS
bool pspell_store_replacement (int $dictionary_link, string $misspelled, string $correct) DESCRIPTION
pspell_store_replacement(3) stores a replacement pair for a word, so that replacement can be returned by pspell_suggest(3) later. In order to be able to take advantage of this function, you have to use pspell_new_personal(3) to open the dictionary. In order to permanently save the replacement pair, you have to use pspell_config_personal(3) and pspell_config_repl(3) to set the path where to save your custom wordlists, and then use pspell_save_wordlist(3) for the changes to be written to disk. PARAMETERS
o $dictionary_link - A dictionary link identifier, opened with pspell_new_personal(3) o $misspelled - The misspelled word. o $correct - The fixed spelling for the $misspelled word. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 pspell_store_replacement(3) <?php $pspell_config = pspell_config_create("en"); pspell_config_personal($pspell_config, "/var/dictionaries/custom.pws"); pspell_config_repl($pspell_config, "/var/dictionaries/custom.repl"); $pspell_link = pspell_new_config($pspell_config); pspell_store_replacement($pspell_link, $misspelled, $correct); pspell_save_wordlist($pspell_link); ?> NOTES
Note This function will not work unless you have pspell .11.2 and aspell .32.5 or later. PHP Documentation Group PSPELL_STORE_REPLACEMENT(3)

Check Out this Related Man Page

PSPELL_NEW(3)								 1							     PSPELL_NEW(3)

pspell_new - Load a new dictionary

SYNOPSIS
int pspell_new (string $language, [string $spelling], [string $jargon], [string $encoding], [int $mode]) DESCRIPTION
pspell_new(3) opens up a new dictionary and returns the dictionary link identifier for use in other pspell functions. For more information and examples, check out inline manual pspell website:http://aspell.net/. PARAMETERS
o $language - The language parameter is the language code which consists of the two letter ISO 639 language code and an optional two letter ISO 3166 country code after a dash or underscore. o $spelling - The spelling parameter is the requested spelling for languages with more than one spelling such as English. Known values are 'american', 'british', and 'canadian'. o $jargon - The jargon parameter contains extra information to distinguish two different words lists that have the same language and spell- ing parameters. o $encoding - The encoding parameter is the encoding that words are expected to be in. Valid values are 'utf-8', 'iso8859-*', 'koi8-r', 'viscii', 'cp1252', 'machine unsigned 16', 'machine unsigned 32'. This parameter is largely untested, so be careful when using. o $mode - The mode parameter is the mode in which spellchecker will work. There are several modes available: o PSPELL_FAST - Fast mode (least number of suggestions) o PSPELL_NORMAL - Normal mode (more suggestions) o PSPELL_BAD_SPELLERS - Slow mode (a lot of suggestions) o PSPELL_RUN_TOGETHER - Consider run-together words as legal compounds. That is, "thecat" will be a legal compound, although there should be a space between the two words. Changing this setting only affects the results returned by pspell_check(3); pspell_suggest(3) will still return suggestions. Mode is a bitmask constructed from different constants listed above. However, PSPELL_FAST, PSPELL_NORMAL and PSPELL_BAD_SPELLERS are mutually exclusive, so you should select only one of them. RETURN VALUES
Returns the dictionary link identifier on success or FALSE on failure. EXAMPLES
Example #1 pspell_new(3) <?php $pspell_link = pspell_new("en", "", "", "", (PSPELL_FAST|PSPELL_RUN_TOGETHER)); ?> PHP Documentation Group PSPELL_NEW(3)
Man Page