Shelling out to Aspell: Linux gurus please
| From: | Geoff Caplan | Date: | Sat, 10 Aug 2002 12:27:50 +0000 |
| Subject: | Shelling out to Aspell: Linux gurus please | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-111941@lists.php.net to get a copy of this message | ||
Hi folks
There is a lot on the web suggesting that the PHP pspell functions are
buggy.
So I am trying to use aspell to check single words by shelling out of
PHP using backticks via the bash shell on Linux. The problem is that
this is a two stage process. First, you launch aspell with "aspell
-a". Aspell then returns an identification message, and waits for a
word to be supplied from standard input. For each misspelled word, it
returns a delimited string of suggestions. But my *nix skills are
limited and I can't figure out how to send the word in the second
command using the backticked string.
The aspell manual page for the -a option is here:
http://aspell.net/aspell-man/6_Writing.html#SECTION00720000000000000000
Also, how to ensure that I don't create orphan aspell processes if for
some reason the request is interrupted?
I know that this is a bit OT and more of a Unix question that a PHP
question, but I am under time pressure and any tips would be much
appreciated.
--
Geoff Caplan
Advantae Ltd
mailto:geoff@advantae.com
http://www.advantae.com