|
użytkowników online: 57
|
OPINIE UŻYTKOWNIKÓW
|
Na początku, kiedy zobaczyłem, że ktoś chce jakiejś opłaty za pomoc w tworzeniu stron ryknąłem śmiechem - potem przyszły problemy... i zaryzykowałem. Druga rzecz to: nie chciałem "kopiować". Ale prawda jest taka: są lepsi, bardziej doświadczeni i... czasem trzeba poprosić o pomoc, a jak poświęca się na to trzecią cześć życia, to nic dziwnego, że nie chce się swoich "sekretów" zdradzać za darmo. Skorzystałem z "algorytmy.pl" i naprawdę jestem z tego w 100% zadowolony, polecam - dla zawodowców (co się uczą) i amatorów (można skorzystać z gotowego rozwiązania).
Tomasz Czypicki
Cybernoxa
|
|
PODRĘCZNIK PHP 5.x, 4.x, 3.x - częściowo spolszczony / źródło: www.php.net
[Spis]
[A]
[B]
[C]
[D]
[E]
[F]
[G]
[H]
[I]
[J]
[K]
[L]
[M]
[N]
[O]
[P]
[Q]
[R]
[S]
[T]
[U]
[V]
[X]
[W]
[Z]
CIII. Pspell Functions
These functions allow you to check the spelling of a word and offer
suggestions.
If you have the libraries needed add the
--with-pspell[=dir] option
when compiling PHP.
Note to Win32 Users:
win32 support is available only in PHP 4.3.3 and later versions.
Also, you must have aspell 0.50 or newer installed.
In order to enable this module under Windows, you must copy
aspell-15.dll from the bin folder
of your aspell installation to a folder where PHP will be able to find it.
C:\PHP or the SYSTEM32 folder of
your windows machine (Ex: C:\WINNT\SYSTEM32 or C:\WINDOWS\SYSTEM32) are good choices.
To rozszerzenie nie definiuje posiada żadnych
dyrektyw konfiguracyjnych w pliku php.ini. To rozszerzenie nie posiada żadnych rodzajów zasobów.
Poniższe stałe są zdefiniowane w tym rozszerzeniu i stają się dostępne, gdy
rozszerzenie jest dokompilowane do PHP, lub załadowane dynamicznie przy starcie.
User Contributed Notesbeau_scott at hotmail dot com
30-Dec-2005 10:13
hehe, forgot to remove the echo $string line... whoops ;)
Should be:
<?
function checkSpelling ( $string )
{
$wordlist = preg_split('/\s/',$string);
$words = array();
for($i = 0; $i < count($wordlist); $i++)
{
$word = trim($wordlist[$i]);
if(!preg_match('/[A-Za-z]/', $word))
continue;
$word = preg_replace('/[^\w\']*(.+)/', '\1', $word);
$word = preg_replace('/([^\W]*)[^\w\']*$/', '\1', $word);
$word = trim($word);
if(!in_array($word, $words, true))
$words[] = $word;
}
$misspelled = $return = array();
$int = pspell_new('en');
foreach ($words as $value)
if (!pspell_check($int, $value))
$misspelled[] = $value;
foreach ($misspelled as $value)
$return[$value] = pspell_suggest($int, $value);
return $return;
}
?>
Gregory Boshoff
14-May-2005 01:23
If you are receiving the error message:
PSPELL couldn't open the dictionary. reason:
No word lists can be found for the language "en".
Add following lines prior to calling pspell_check:
$pspell_config = pspell_config_create("en");
$pspell_link = pspell_new_config($pspell_config);
abhishek dot ratani at gmail dot com
22-Feb-2005 11:46
flint at modulusgroup dot com
29-Dec-2004 11:19
For those will problems installing on Win32 with IIS:
Symptom: browser just hangs when calling pspell function. Running PHP.exe from command line causes pspell to claim that there is a corrupt file. Running Aspell works just fine on the command line.
You need new data files:
You can download and get more information about it here:
http://wiki.wordpress.org/SpellCheck
Just replace the data directory in C:\Programs Files\Aspell\ with the new data directory you downloaded.
No more problems.
10-Dec-2004 10:52
tidd
28-Sep-2004 07:31
In response to csnyder's comment about calling aspell instead of using the aspell or pspell libs:
If you are running a low traffic site this will work fine and it's a good idea.
If, however, you have many customers using your spell checking script, this method does not scale well and you should consider spending the time to make the libs work properly.
webmaster at script-tease dot net
12-Apr-2004 04:26
Easy way to make a spellchecker:
<?
function spellcheck ( $string ) {
$words = preg_split('/[\W]+?/',$string);
$misspelled = $return = array();
$int = pspell_new('en');
foreach ($words as $value) {
if (!pspell_check($int, $value)) {
$misspelled[] = $value;
}
}
foreach ($misspelled as $value) {
$return[$value] = pspell_suggest($int, $value);
}
return $return;
}
?>
jrweir _a_t_ yahoo
30-Mar-2004 09:15
I had the same problems after following the detailed instructions for installing on windows but was able to solve them by doing the following:
first, I copied all the files in the data directory of the aspell install (ie. C:\Program Files\Aspell\data) to a unix machine and ran dos2unix on all of the files and then copied them back.
second, added this line before the pspell_new("en") call
pspell_config_create("en");
hope this works for you too.
kevina at gnu dot org
12-Jan-2003 11:19
Aspell Author Here.
Since Aspell 0.50, Pspell is no longer used. It is not necessary to download and install the Pspell package, only Aspell 0.50 (or better) is required. Aspell now provided a backwards compatibility interface for programs expecting the old Pspell interface (such as PHP).
Even though Aspell now provided a new "Aspell" interface this, the PHP Pspell interface is the one you want to use. The Aspell PHP interface is the one used with a *very* old version of Aspell as the manual says.
Sorry if this is confusing, but it is not really my fought as I have no control over PHP development. Eventually a new Aspell interface should be provided for PHP which uses the new Aspell interface provided with Aspell 0.50 but for now the Pspell interface will work just fine.
Note: If you wish to use an older version of Aspell (_before_ 0.50) than both Aspell and Pspell are required.
csnyder at chxo dot com
11-Oct-2002 09:37
As an alternative to mucking about with the compiled-in aspell/pspell functions, which only check word by word, one could write a script that calls aspell as a shell exec to check a whole block of text:
http://chxo.com/scripts/spellcheck.php
(there is a view-source option)
Not sure about Linux or Windows, but installing aspell on FreeBSD was trivially easy from the ports collection. No doubt such a script could be easily modified to use ispell instead if you'd rather.
|