PHP  
downloads | documentation | faq | getting help | mailing lists | | php.net sites | links | my php.net 
search for in the  
<printer_writepspell_add_to_personal>
view the version of this page
Last updated: Sat, 19 Apr 2003

LXXXV. Pspell Funktionen

Einf�hrung

Diese Funktionen erm�glichen Ihnen, die Rechtschreibung eines Wortes zu pr�fen und bieten �nderungsvorschl�ge an.

Anmerkung: This extension is not available on Windows platforms.

Anforderungen

Um PHP mit pspell-Unterst�tzung zu compilieren, brauchen Sie die aspell- und pspell-Bibliotheken, die Sie unter , bzw. bekommen.

Installation

Falls Sie die ben�tigten Bibliotheken haben, k�nnen Sie PHP mit der Option --with-pspell[=dir] �bersetzen.

Laufzeit Konfiguration

Diese Erweiterung definiert keine Konfigurationseinstellungen in der php.ini.

Resource Typen

Diese Erweiterung definiert keine Resource-Typen.

Vordefinierte Konstanten

Folgende Konstanten werden von dieser Erweiterung definiert und stehen nur zur Verf�gung, wenn die Erweiterung entweder statisch in PHP kompiliert oder dynamisch zur Laufzeit geladen wurde.

PSPELL_FAST (integer)

PSPELL_NORMAL (integer)

PSPELL_BAD_SPELLERS (integer)

PSPELL_RUN_TOGETHER (integer)

Inhaltsverzeichnis
pspell_add_to_personal --  F�gt der pers�nlichen Wortliste ein Wort hinzu
pspell_add_to_session --  F�gt der Wortliste der aktuellen Sitzung ein Wort hinzu
pspell_check -- �berpr�ft ein Wort
pspell_clear_session -- L�scht die aktuelle Sitzung
pspell_config_create --  Erzeugt eine Konfiguration zum �ffnen eines W�rterbuchs
pspell_config_ignore --  Ignoriert W�rter mit weniger als N Buchstaben
pspell_config_mode --  �ndert den Modus f�r die Anzahl gelieferter Vorschl�ge
pspell_config_personal --  Setzt die Datei, die die pers�nliche Wortliste enth�lt
pspell_config_repl --  Setzt die Datei, welche die Ersetzen-Paare enth�lt
pspell_config_runtogether --  Betrachtet zusammengesetzte W�rter als g�ltige Verbindungen
pspell_config_save_repl --  Bestimmt, ob Ersetzen-Paare zusammen mit der Wortliste gespeichert werden
pspell_new_config --  L�dt ein neues W�rterbuch mit den Einstellungen einer angegebenen Konfiguration
pspell_new_personal --  L�dt ein neues W�rterbuch mit pers�nlicher Wortliste
pspell_new -- L�dt ein neues W�rterbuch
pspell_save_wordlist --  Speichert die pers�nliche Wortliste in einer Datei
pspell_store_replacement --  Speichert das Ersetzen-Paar f�r ein Wort
pspell_suggest --  Macht Vorschl�ge f�r die Schreibweise eines Wortes


User Contributed Notes
Pspell Funktionen
add a note
taitg at php dot net
12-Dec-2001 11:16

If you can't get ASPELL, PSPELL and PHP configured properly (like errors in the make of PHP) then the author of ASPELL has broken source backward compatibility.

The best remedy is to grab an older version of ASPELL and PSPELL.

--Tait

jonathan at sharpmedia dot net
21-Jun-2002 12:00

I origonally compiled Pspell/Aspell/Php and got the �Unable to load �aspell� module.� error. Here is what I did to get a fully working pspell.

Configuration
RedHat 7.2 (installed without pspell/aspell)
php4.2.1 (DSO), pspell .12.2, aspell .33.7.1, Apache 1.3.24 (mod_ssl)

cd aspell
# I did not specify a prefix
./configure
make
make install

cd pspell
# I did not specify a prefix
./configure
make
cd modules
./add-modules
cd ..
make
make install
# For ldconfig /usr/local/lib was not in it�s path, so I had to edit /etc/ld.so.conf and add: /usr/local/lib
ldconfig -v
cd ..

cd php
./configure --with-pspell=/usr/local \
--other config options etc
make
make install

sudhakar at mindscapecomputing dot com
07-Sep-2002 08:50

The Following Steps to install Aspell and Pspell to work with PHP

Download these files


Pspell Package

Aspell Package

English Dictionary
for Aspell

untar the files
tar zxvf pspell-.12.2.tar.gz
tar zxvf aspell-0.50.1.tar.gz
tar jxvf aspell-en-0.50-2.tar.bz2

we have to install pspell first:

Get into the pspell-.12.2 directory

   # ./configure
   # make
   # make install

   # cd modules
   # ./add-modules
   # cd ..
   # make
   # make install

Second we have to install Aspell:
Get into the aspell-0.50.1 directory

   # ./configure
   # make
  # make install

After Sucessfully compiled Apply the Dictionary
Get into the  aspell-en-0.50-2 directory

   # ./configure

 Which should output something like:

Finding Dictionary file location ... /usr/local/lib/aspell
 Finding Data file location ... /usr/local/share/aspell

  # make
  # make install

To Check aspell is working try this example

Create a file test.txt add the line  "I am speled wron" and save the file

 # aspell check test.txt

from the command line.
after the above example work.

use --with-pspell when compiling PHP

20-Sep-2002 05:30
[quote]
untar the files
tar zxvf pspell-.12.2.tar.gz
tar zxvf aspell-0.50.1.tar.gz
tar yxf aspell-en-0.50-2.tar.bz2
[/quote]

Needs to be changed to...

untar the files
tar zxvf pspell-.12.2.tar.gz
tar zxvf aspell-0.50.1.tar.gz
tar jxvf aspell-en-0.50-2.tar.bz2

(j is not a known command)

news dot letters at web dot de
06-Oct-2002 05:41

I did experiance problems while extracting the english dictionary because it is not in tar.gz format. The example stated above has a spellerror :-)

Untar it like this:
tar jxf aspell-en-0.50-2.tar.bz2

notice the j instead of a y

Cheers,

Andy

csnyder at chxo dot com
11-Oct-2002 07: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:


(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.

joeldegan AT yahoo.com
19-Dec-2002 11:42

Got this to work in mandrake 8.2

I found I could only configure the dictionaries as a non-root user.
then
make
and
su make install
works fine now..

kevina at gnu dot org
12-Jan-2003 09: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.

dswhite42 at yahoo dot com
04-Apr-2003 11:09

Trying to compile PHP 4.3.1 --with-pspell (using Aspell 0.50.3) produced a lot of errors at the end about missing symbols (aspell_speller_store_replacement, aspell_speller_add_to_session, etc. etc - all the regular aspell stuff).

It appeared that the problem was that adding --with-pspell as a "configure" option only adds "-lpspell" to the gcc list of libraries, when it actually needs the aspell libraries as well.

In my case, I solved it by starting with a clean PHP 4.3.1 distribution, editing the "configure" script and changing the LIBS line for pspell (line 62147 in this case) from:

     LIBS="-lpspell $LIBS"

to:

    LIBS="-laspell -lpspell $LIBS"

then continuing the configure/compile process as normal.

add a note

<printer_writepspell_add_to_personal>
 Last updated: Sat, 19 Apr 2003
show source | credits | mirror sites 
Copyright © 2001-2003 The PHP Group
All rights reserved.
This mirror generously provided by: /
Last updated: Wed May 14 01:12:44 2003 CEST