Re: Package Proposal: SpellChecker
| From: | Stan Lemon | Date: | Fri, 08 Aug 2003 13:24:18 +0000 |
| Subject: | Re: Package Proposal: SpellChecker | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-19400@lists.php.net to get a copy of this message | ||
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 and found no entries so I figured I'd offer a small class I drew up this week for spell checking in PHP. It does require --with-pspell to be installed. 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> with yellow background 4) Can return suggested spellings of mispelled words. - By default the <span> tag that does the highlight sticks suggestions in title attributeallowing them to be viewed by simply hovering the mouse over it - If default behavior isn't desired, methods exist to grab the suggestions and do custom handling5) Works fine with HTML/XML- This is done by saving copy of the original text we are checking and then stripping out HTML/XML, doing the spell check and replacing the mispellings in the original text 6) Goes without saying but it is a lightweight and OO and should plugin easily to existingapplicaitons Only down side is you will probably spend more time getting aspell/pspell working and recompiling PHP than you will with trying to implement 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