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.
[画像:Picture of Felipe Ribeiro] |
|
Innovation award Innovation award Nominee: 1x Winner: 1x |
This class was writen by Felipe Ribeiro <[email protected]> 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* ?>
File | Role | Description |
---|---|---|
Accessible without login Plain text file README | Doc. | README file |
Plain text file SpellCorrector.php | Class | The class itself |
User Ratings | |||||||||||||||||||||||
|
Add link image If you know an application of this package, send a message to the author to add a link here.
Latest pages that reference packages Latest pages that reference packages