https://github.com/thinkphp/google-spell-check
Plugin MooTools which allows you to provide spell checking for text. It uses Google API to check if the text is correct and to get some suggestions. This is done by PHP that uses cURL to get some xml and translates it to JSON, so we can use Request.JSON for out client-side.
https://github.com/thinkphp/google-spell-check
Last synced: 3 months ago
JSON representation
Plugin MooTools which allows you to provide spell checking for text. It uses Google API to check if the text is correct and to get some suggestions. This is done by PHP that uses cURL to get some xml and translates it to JSON, so we can use Request.JSON for out client-side.
- Host: GitHub
- URL: https://github.com/thinkphp/google-spell-check
- Owner: thinkphp
- Created: 2010-10-14T10:32:15.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2010-10-14T10:42:13.000Z (over 15 years ago)
- Last Synced: 2024-04-14T14:54:26.927Z (almost 2 years ago)
- Language: PHP
- Homepage: http://thinkphp.ro/apps/google/google-spell-check/
- Size: 89.8 KB
- Stars: 4
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Request.SpellCheck
==================
This class allows you to provide spell checking for text. It uses Google API to check if the text is correct and
to get some suggestions. This is done by PHP that uses cURL to get some xml and translates it to JSON, so we can
use Request.JSON for out client-side. That is where Request.SpellCheck is build on. Request.SpellCheck will give
you an array in the onSuccess event that you can use.

How to use
----------
First you must to include the JS files in the head of your HTML document.
#HTML
In your JS.
#JS
window.addEvent('domready',function(){
var spell = new Request.SpellCheck({
url: 'spellcheck.php',
onSuccess: function(suggestions, data, response, text) {
var text = text;
$each(suggestions,function(suggest){
var word = suggest.text;
text = text.replace(word,''+word+' ('+suggest.suggestions.join(',')+')');
});
$('spellzone').set('html',text);
}
});
var val = document.id('input_text');
$('spell').addEvent('click',function(){
if(val){
spell.spellcheck(val.get('value'));
}
})
});