PHP.mk документација

Примери

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

enchant.examples.php PHP.net прокси Преводот е вчитан
Оригинал на PHP.net
Патека enchant.examples.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + преведен приказ Кодовите, табелите и белешките остануваат читливи во истиот тек.
Примери

Референца за `enchant.examples.php` со подобрена типографија и навигација.

enchant.examples.php

Примери

Пример #1 Пример за употреба на Enchant

<?php
$tag
= 'en_US';
$r = enchant_broker_init();
$bprovides = enchant_broker_describe($r);
echo
"Current broker provides the following backend(s):\n";
print_r($bprovides);

$dicts = enchant_broker_list_dicts($r);
print_r($dicts);
if (
enchant_broker_dict_exists($r,$tag)) {
$d = enchant_broker_request_dict($r, $tag);
$dprovides = enchant_dict_describe($d);
echo
"dictionary $tag provides:\n";
$wordcorrect = enchant_dict_check($d, "soong");
print_r($dprovides);
if (!
$wordcorrect) {
$suggs = enchant_dict_suggest($d, "soong");
echo
"Suggestions for 'soong':";
print_r($suggs);
}
enchant_broker_free_dict($d);
} else {
}
enchant_broker_free($r);
?>

Белешки од корисници 3 белешки

z dot himdi на bita dot nl
пред 13 години
Here is help for Windows users:

You need to add dictionaries to your computer for Enchant.

1. Enchant looks in your registry keys, I don't know what keys it wants, but it looks here - I ignored all of these:
  * Default User\Software\Enchant\Config 
  * Default User\Software\Enchant\Ispell
  * Default User\Software\Enchant\Myspell
2. It looks for OpenOffice dictionaries (from the registry settings for OpenOffice)
3. It looks in folder [PHP]\share\myspell\dicts

I got it working by copying the en-us dictionary files from Firefox into \share\myspell\dicts, and renaming them en_US.*.  You can download and install dictionaries from OpenOffice from here I think: http://extensions.services.openoffice.org/dictionary

Enchant creates and writes to the following folder, so you must allow PHP read and write permissions to: [SYSTEM32]\config\systemprofile\Application Data\enchant

It would be convenient if Enchant could accept parameters to specify the location of the main dictionaries and user-dictionaries, I suppose the registry keys are the only way to do it.
z dot himdi на bita dot nl
12 години пред
To repeat a note by  wschalle at gmail dot com on page http://www.php.net/manual/en/book.enchant.php

The enchant library does not work unless libenchant_myspell.dll and libenchant_ispell.dll are placed in [PHP]\lib\enchant from PHP 5.4.13.

Dictionaries will still load from [PHP]\share\myspell\dicts.
ch1902
12 години пред
One thing to add to robert.johnson's very helpful post, I found that the dictionary files (*.dic and *.aff) could only contain A-Z and _ characters or they wouldn't be listed in the output of enchant_broker_list_dicts() (at least for PHP 5.4 / Windows).

This was an issue when downloading some of the dictionary files from https://addons.mozilla.org/firefox/language-tools/ where the file names contained hyphens, pt-BR for example. Just replace the hyphen with an underscore in the file name and enchant recognises the language code.
На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.