PHP Classes
elePHPant
Icontem

PHP Spell Checker: Check spelling of text and get fix suggestions

Recommend this page to a friend!

  Author Author  
Name: Protung Dragos <contact>
Classes: 10 packages by
Country: Germany Germany
Innovation award
Innovation award
Nominee: 3x


  Detailed description   Download Download .zip .tar.gz   Install with Composer Install with Composer  
This package can be used to check the spelling of text and get fix suggestions.

There is a base class that defines functions for spell checking.

There are also two classes for checking the spelling of text using either PHP scripts that contain arrays of valid words and grammar definitions, or using the hunspell program.

If the classes determine that there are misspelled words, they may return suggestions for eventual fixes.

Details
{startverticalbanner}
       ___________________________________________________________

            PHP Spell Checker & Spell Suggestion - Version 1.1
                             February 2010
       ___________________________________________________________

                   Copyright (c) 2010 Dragos Protung

_______________________

CONTENTS
_______________________

1. Description
2. System Requirements
3. How to use
4. Contact

_______________________

1. Product Description
_______________________

This class can be used to check the spelling of texts and also provide suggestions in case some words are spelled wrong.

_______________________

2. System Requirements
_______________________

PHP 5.x - required
hunspell - optional: if you don't have it then you can use the pure PHP based version or Google 'Did you mean' version
______________

3. How to use
______________

3.1 - Installation
	this class uses affix dictionaries. This means that you can use the dictionaries from OpenOffice or Mozilla products.
	Just go to https://addons.mozilla.org/en-US/firefox/browse/type:3 and download the dictionaries that you want.
	Unpack the *.xpi files and extract the *.aff and *.dic files into dictionaries/hunspell/ folder.
	This class also works with MySpell dictionaries.
	There is nothing more you have to do, just start using the class. Please read further and then take a look at the examples.

3.2 - HunSpell version
	The hunspell version of this class is preferred.
	It uses less memory for complex languages or with a very big dictionary (over 150.000 words) and the word suggestion is excellent.
	You can get the binaries from http://sourceforge.net/projects/hunspell/files/Hunspell/1.2.8/
	When using this version of the class you need to specify where hunspell is installed by calling the setHunspellPath() method
	or add hunspell to the system path.
	
3.3 - PHP version
	In case you can not install hunspell on your server you can use a pure PHP version.
	The words suggestions is not as good as the HunSpell version (will implement a new algorithm soon).
	Also the PHP version can use a lot of memory for complex languages or with a very big dictionary (over 150.000 words).
	As an example, for German languages the script can use over 100Mb. On the other hand for simple languages it only uses about 10Mb.
	The affix dictionaries can not be used as it is. They need to be converted to PHP code.
	This can be done manuall by calling the compileHunAffixDictionary() method.
	If the dictionary is not compiled yet, the first time you use it it will try to compile it from hunspell.
	For complex languages this file can be over 15Mb.
3.4 - Google 'Did you mean'
	You can use this version to use google's 'Did you mean' function
	The class sends a query to google website and checks for any misspelled words.
	
3.5 - Known bugs, accuracy and performance concerns
	There are several known bugs:
		- initially if a word has the suffix doubled (misspell) the spell checker reports it as a correct word. (pure PHP version only)
		  There is a fix implmented that will rezolve the issue but if a word is correctly spelled with the doubled sufix it will be reported ar wrong.
		  You can remove the fix by commenting the 93-95 lines in PHPSpellChecker.class.php
		- in some languages there is a need for a special encoding and this is not yet supported (will be soon)
	Accuracy: (pure PHP version)
		- Word suggestion is not very smart. It's just a simple "algorithm". I plan on improveing this (maybe you can help out)
	Performance:
		- For very complex languages, or with a very big dictionary (over 150.000 words) (pure PHP version only) the script can use alot of memmory (100Mb)

3.6 - Conclusion
	The PHP version can be used very efficient for simple languages or with small dictionary (ex. english)
	This is just the first release and it will be greatlly improved.
	If you use Google 'Did you mean' you might get banned by Google for using this service.
	If you want to participate on this project please contact me. 
______________

4. Contact
______________

Please send your suggestions, bug reports and general feedback to dragos@protung.ro
Also visit http://www.protung.ro


Out for now ;)

  Classes of Protung Dragos  >  PHP Spell Checker  >  Download Download .zip .tar.gz  >  Support forum Support forum (1)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: PHP Spell Checker
Base name: phpspellchecker
Description: Check spelling of text and get fix suggestions
Version: 1.1
PHP version: 5.0
License: GNU Lesser General Public License (LGPL)
 
  Groups   Screenshots Screenshots   Trackback   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Text processing Manipulating and validating text data View top rated classes

  Files folder image Screenshots  
phpspellchecker.jpg
File Role Description
Accessible without login Image file phpspellchecker.jpg Screen Screenshot of interactive example


  Pages that reference this package  
PHP Spell Checker v1.1
A new version of PHP Spell Checker is available...

Latest pages that reference packages Latest pages that reference packages


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder imagedictionaries (3 directories)
Files folder imageexamples (4 files)
Plain text file GDYMSpellChecker.class.php Class Check spelling using Google 'Did you mean' version
Plain text file HunSpellChecker.class.php Class Check spelling using HunSpell
Accessible without login Plain text file license.txt Lic. License
Plain text file PHPSpellChecker.class.php Class Check spelling in pure PHP
Accessible without login Plain text file readme.txt Doc. Read me text
Plain text file SpellChecker.class.php Class Abstract spell checker class

  Files folder image Files  /  dictionaries  
File Role Description
Files folder imagecustom (1 file)
Files folder imagehunspell (1 file)
Files folder imagephp (1 file)

  Files folder image Files  /  dictionaries  /  custom  
File Role Description
  Accessible without login Plain text file en-US.php Aux. Custom dictionary for en-US

  Files folder image Files  /  dictionaries  /  hunspell  
File Role Description
  Accessible without login Plain text file empty.txt Data Dummy file

  Files folder image Files  /  dictionaries  /  php  
File Role Description
  Accessible without login Plain text file empty.txt Data Dummy file

  Files folder image Files  /  examples  
File Role Description
  Accessible without login Plain text file gdymBased.php Example Example script for google 'Did you mean' version
  Accessible without login Plain text file hunspellBased.php Example Example script for HunSpell version
  Accessible without login Plain text file interactiveForm.php Example Example script with interface
  Accessible without login Plain text file phpBased.php Example Example script for pure PHP version

Install with Composer Install with Composer - Download Download all files: phpspellchecker.tar.gz phpspellchecker.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.