News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Find and Correct Misspelled Words with Pspell
November 25, 2013 @ 11:23:55

On the SitePoint PHP blog there's a new tutorial talking about finding spelling errors in the input your user provides to your application. They use the powerful pspell functionality that can be compiled into PHP to run the checking.

Every one of us has made a spelling mistake in a Google search: "alternitive music", for example. In doing so, you may have noticed that Google was trying to help you by displaying: "Did you mean alternative music?". If your site has a search function, to indicate misspellings if no or too few results have been found is a very useful feature, especially if the bad English of a visitor can make you miss a sale. Fortunately, PHP's Pspell module allows for checking the spelling of a word and suggesting a replacement from its default dictionary (you can also create a custom dictionary).

He introduces the functionality through a simple function that takes in a string to check, sets up a new dictionary object and runs a pspell_suggest call to get spelling fix suggestions. He talks about the importance of the dictionary and, the modes you can use for checking (speed) and how to add a custom dictionary of your own.

0 comments voice your opinion now!
pspell misspelled words tutorial

Link: http://www.sitepoint.com/find-correct-misspelled-words-pspell/

blog comments powered by Disqus

Similar Posts

MrPHP.com.au: Image Cache using phpThumb and .htaccess

Stefan Mischook's Blog: Object Oriented PHP Tutorial in PDF

DevShed: The Basics of Abstract Factory Classes in PHP 5

O'Reilly Broadcast: Getting Drupal and mod_security to Play Nicely Together on Red Hat 5.x Servers

IBM developerWorks: Java and PHP technology on AIX - Integrate the Java business application w/ DB2


Community Events











Don't see your event here?
Let us know!


facebook framework overview podcast database introduction symfony2 hhvm component language performance install release application package unittest opinion security composer hack

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework