PDA

View Full Version : aspell and pspell



costelloc
02-12-2006, 09:33 AM
To have spell checking in most php applications you need aspell installed and pspell compiled into php. Adding this would be great.

DuckFat
10-17-2006, 07:51 PM
Very disappointed that aspell doesn't work. This may actually lead to a cancellation unless something can be figured out. Can this please be revisited and see if a solution can be found with the newer versions of PHP and all?

wildjokerdesign
10-18-2006, 04:57 AM
I was able to get aspell installed but since we do not have access to php config I am not able to configure it with what I have installed. I am sure if I where to contact West Host they could have a system admin do that for me but have not had the time to take that last step. I don't have the time at the moment to move forward with this but when I do I'll try to give a rundown of what has to happen to get it running.

WestHost - CRussell
11-05-2006, 06:19 PM
We are working on launching an updated version of PHP4 & 5 soon. I have let our development team know about this suggestion.

wildjokerdesign
01-23-2007, 11:49 AM
I was able to find the time to dig a bit deeper into this and I did submit a support ticket asking if they could run ./configure --with-pspell=[path to my installation] but alas was refused. :(

I have played some with building my install of php but that creates some other issues that I have not been able to work out to my satisfaction. So unless in the next upgrade of php support is added for either pspell or the ability to run configure make and make install on php we are stuck.

WestHost - JFillmore
01-24-2007, 09:54 AM
wildjokerdesign,

You can actually install aspell for PHP into your account without having access to the source files that your build of PHP was created from. Instead of being directly compiled in, you can compile a shared library that you load in your php.ini file.

However, with the release of PHP 4.4.4 and PHP 5.2.0 just around the corner this shouldn't be necessary. I can confirm for you here that they'll both have aspell included. The English dictionary is automatically installed by default, but if you want extra languages then you can add as many as you like.

For example, to install the German dictionary:

1. Install the 'GNU Compiler Collection' Site Application
2. Run the following shell commands:

cd
mkdir src
cd src
wget wget ftp://ftp.gnu.org/gnu/aspell/dict/de/aspell6-de-20030222-1.tar.bz2
tar -xjf aspell6-de-20030222-1.tar.bz2
cd aspell6-de-20030222-1
PATH="$PATH:/usr/local/php/dependencies/bin" ./configure
make
make install
3. Confirm that it works with a simple PHP script:

[~]$ cat pspell_de.php
<?php

$words = array('die', 'dei', 'mich');
$pspeller = pspell_new("de");
foreach ( $words as $word ) {
if ( pspell_check($pspeller, $word) ) {
echo "Correctly spelled word: " . $word . "\n";
} else {
echo "Mispelled word: " . $word . "\n";
}
}

?>
[~]$ php pspell_de.php
Correctly spelled word: die
Mispelled word: dei
Correctly spelled word: mich

wildjokerdesign
01-24-2007, 10:52 AM
Johnny,
Thank you so much for the information. I would be interested if you have time to know more about "Instead of being directly compiled in, you can compile a shared library that you load in your php.ini file.". I did try loading aspell dynamically which I think is what you are talking about but I evidently had something wrong. :) I was having problems finding information on the web about the process so I was just kind of guessing with the little bit I could glean.

I well wait for the upgrades of php for my main site I want to use this on but would like to try the shared library method on my test account as an exercise. If you know of any links you think would help me to accomplish this I would be grateful. I guess I should go to the book store and see if I could find some Dummies guides to... ;)

Thank you again for the information and I look forward to the availability of PHP 4.4.4 and PHP 5.2.0.