PHP: Hypertext Preprocessor (original) (raw)
pspell_config_mode
(PHP 4 >= 4.0.2, PHP 5, PHP 7, PHP 8)
pspell_config_mode — Change the mode number of suggestions returned
Description
pspell_config_mode() should be used on a config before calling pspell_new_config(). This function determines how many suggestions will be returned bypspell_suggest().
Parameters
config
An PSpell\Config instance.
mode
The mode parameter is the mode in which spellchecker will work. There are several modes available:
[PSPELL_FAST](pspell.constants.php#constant.pspell-fast)
- Fast mode (least number of suggestions)[PSPELL_NORMAL](pspell.constants.php#constant.pspell-normal)
- Normal mode (more suggestions)[PSPELL_BAD_SPELLERS](pspell.constants.php#constant.pspell-bad-spellers)
- Slow mode (a lot of suggestions)
Return Values
Returns [true](reserved.constants.php#constant.true)
on success or [false](reserved.constants.php#constant.false)
on failure.
Changelog
Version | Description |
---|---|
8.1.0 | The config parameter expects an PSpell\Config instance now; previously, a resource was expected. |
Examples
Example #1 pspell_config_mode() Example
<?php $pspell_config = pspell_config_create("en"); pspell_config_mode($pspell_config, PSPELL_FAST); <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mi>s</mi><mi>p</mi><mi>e</mi><mi>l</mi><mi>l</mi><mo>=</mo><mi>p</mi><mi>s</mi><mi>p</mi><mi>e</mi><mi>l</mi><msub><mi>l</mi><mi>n</mi></msub><mi>e</mi><msub><mi>w</mi><mi>c</mi></msub><mi>o</mi><mi>n</mi><mi>f</mi><mi>i</mi><mi>g</mi><mo stretchy="false">(</mo></mrow><annotation encoding="application/x-tex">pspell = pspell_new_config(</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span><span class="mord mathnormal">s</span><span class="mord mathnormal">p</span><span class="mord mathnormal">e</span><span class="mord mathnormal" style="margin-right:0.01968em;">ll</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mord mathnormal">s</span><span class="mord mathnormal">p</span><span class="mord mathnormal">e</span><span class="mord mathnormal" style="margin-right:0.01968em;">l</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.01968em;">l</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.0197em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">e</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.02691em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">c</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">o</span><span class="mord mathnormal">n</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mord mathnormal">i</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mopen">(</span></span></span></span>pspell_config); pspell_check($pspell, "thecat"); ?>
Found A Problem?
There are no user contributed notes for this page.