Re: Re: Package Proposal: SpellChecker
| From: | Stan Lemon | Date: | Fri, 08 Aug 2003 13:56:03 +0000 |
| Subject: | Re: Re: Package Proposal: SpellChecker | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-19403@lists.php.net to get a copy of this message | ||
No, you didn't understand what I'm saying.
I'm not suggesting the use the old, archaic aspell functions that PHP used to have. I'm talking about calling the binary from php and using that. Most *nix boxes comes with /usr/bin/apell and you can call that through shellexec() and spell check that way. For those of you that use Squirrelmail it does spell checking in this manner and works incredibly well.
What I'm suggesting is that a spell checking package not use the built in spell checking functions of php at all. I have had a heck of a time even working with the new pspell ones, and I'll be honest, I haven't seen many web hosts with those extensions installed either.
I tink using the aspell binary standalone, rather then php's built in spell checking stuff would prove to be more usable.
- Stan
Limbourg Arnaud wrote:
From the notes on php site Note: This extension has been removed from PHP and is no longer available as of PHP 4.3.0. If you want to use spell-checking capabilities in PHP, use pspell instead. It uses pspell library and works with newer versions of aspell. aspell works only with very old (up to .27.* or so) versions of aspell library. Neither this module, nor those versions of aspell library are supported any longer. You need the aspell library, available from: http://aspell.sourceforge.net/. Arnaud.Maybe you should consider having it depend on the Aspell binary being installed, rather then the pspell extension. Reason is, the pspell extension is completely unavailable on Windows, and is a royal pain to get working. Whereas the Aspell binary is a wiz to install and is available on all operating systems. You could use shelexec() to send the info to the binary and then have it write a temp file. I actually have a script (a very nice script) which does this. Lately I haven't seen many scripts which use the pspell extension, it seems to have *really* fallen by the way side. If I were you I'd look at the binary. Make it a heck of a lot easier on the developer. - Stan Tony Bibbs wrote:I did a quick package search on 'spell' on pear.php.net andfound noentries so I figured I'd offer a small class I drew up thisweek forspell checking in PHP. It does require --with-pspell to beinstalled.Quick feature run down: 1) Supports any languages supported by pspell/aspell. 2) Supports personalized word lists 3) Supports highlighting of misspelled words in text that is checked - Highlight method is customizable. Default is to use a<span> withyellow background 4) Can return suggested spellings of mispelled words. - By default the <span> tag that does the highlight sticks suggestions in title attributemouse over itallowing them to be viewed by simply hovering the- If default behavior isn't desired, methods exist to grab the suggestions and do customare checkinghandling5) Works fine with HTML/XML - This is done by saving copy of the original text weand then stripping outmispellings inHTML/XML, doing the spell check and replacing thethe original text 6) Goes without saying but it is a lightweight and OO andshould plugineasily to existing applicaitons Only down side is you will probably spend more time getting aspell/pspell working and recompiling PHP than you willwith trying toimplement it. If accepted I'd seek the proper PEAR category to put it in, I was thinking Tools and Utilities but I'd be open to suggestions. --Tony-- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php