PHP Classes

Spell Corrector: Suggest corrected spelling text in pure PHP

Recommend this page to a friend!
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (4)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 62%Total: 7,178 This week: 1All time: 268 This week: 89Up
Version License PHP version Categories
spellcorrector 0.1BSD License5.0Algorithms, PHP 5, Text processing
Description 

Author

This class can be used to suggest the correct spelling of text similar to Google "Did you mean" but based on a pure PHP implementation of Peter Norvig correct spelling suggestion algorithm.

It takes a given word and returns a suggestion of the probable correct spelling of the word.

The class can build a dictionary with correctly spelled words from a training text document. The dictionary can be stored in a cache file by serializing the dictionary array.

A sample training text document can be obtained from Peter Norvig site.

Innovation Award
PHP Programming Innovation award winner
October 2008
Winner


Prize: One copy of the Zend Studio
Google provides spelling suggestions to search keywords that seem misspelled.

There is already a PHP class that uses that Google search feature to suggest corrections to given text strings that may be misspelled.

This class provides a a similar solution to Google "Did you mean" to suggest the correct spelling of words. It uses pure PHP code and does not require accessing remote site.

Manuel Lemos
Picture of Felipe Ribeiro
Name: Felipe Ribeiro is available for providing paid consulting. Contact Felipe Ribeiro .
Classes: 2 packages by
Country: Brazil Brazil
Age: 39
All time rank: 22112 in Brazil Brazil
Week rank: 91 Up6 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 1x

Winner: 1x

Details

This class was writen by Felipe Ribeiro <felipernb@gmail.com> using the concepts of Peter Norvig available at www.norvig.com/spell-correct.html. To use this class, you should first download a sample text to be used as dictionary at: www.norvig.com/big.txt then just do: <?php include 'SpellCorrector.php'; echo SpellCorrector::correct('octabr'); //it will output *october* ?>

  Files folder image Files  
File Role Description
Accessible without login Plain text file README Doc. README file
Plain text file SpellCorrector.php Class The class itself

 Version Control Unique User Downloads Download Rankings  
 0%
Total:7,178
This week:1
All time:268
This week:89Up
 User Ratings  
 
 All time
Utility:92%StarStarStarStarStar
Consistency:89%StarStarStarStarStar
Documentation:75%StarStarStarStar
Examples:-
Tests:-
Videos:-
Overall:62%StarStarStarStar
Rank:871