Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oliverschloebe/google-spell-pspell
A PHP Pspell substitute for Google Spell Check XML API.
https://github.com/oliverschloebe/google-spell-pspell
google-spell-pspell php php-pspell-substitute pspell xml-structure
Last synced: 24 days ago
JSON representation
A PHP Pspell substitute for Google Spell Check XML API.
- Host: GitHub
- URL: https://github.com/oliverschloebe/google-spell-pspell
- Owner: oliverschloebe
- License: mit
- Created: 2013-07-13T14:24:01.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2024-08-18T15:25:35.000Z (5 months ago)
- Last Synced: 2024-12-04T13:46:46.069Z (about 1 month ago)
- Topics: google-spell-pspell, php, php-pspell-substitute, pspell, xml-structure
- Language: PHP
- Size: 28.3 KB
- Stars: 21
- Watchers: 5
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# google-spell-pspell
[![License](https://img.shields.io/packagist/l/oliverschloebe/google-spell-pspell.svg)](https://github.com/oliverschloebe/google-spell-pspell/blob/main/LICENSE)
[![Latest Stable Version](https://img.shields.io/packagist/v/oliverschloebe/google-spell-pspell.svg)](https://packagist.org/packages/oliverschloebe/google-spell-pspell)
[![Latest Version](https://img.shields.io/github/release/oliverschloebe/google-spell-pspell.svg?style=flat-square)](https://github.com/oliverschloebe/google-spell-pspell/releases)
[![Source Code](https://img.shields.io/badge/source-oliverschloebe/google--spell--pspell-blue.svg?style=flat-square)](https://github.com/oliverschloebe/google-spell-pspell)A PHP Pspell substitute for Google Spell Check XML API. Pspell is required in order to work on your server.
## Why?
Google obviously shut down their Spell checking API (www.google.com/tbproxy/spell) on July 9th 2013, see [here](http://productforums.google.com/forum/#!topic/chat/CPb0PYllbE8). This PHP class is a PHP Pspell substitute for Google Spell Check XML API using the same XML structure.
## Usage
```php
require_once 'spell-check-library.php';
$content = "";
$options = array(
"lang" => 'en',
"maxSuggestions" => 10,
"customDict" => 0,
"charset" => 'utf-8'
);
$factory = new SpellChecker($options);$spell = $factory->create(trim("Ths is a tst"));
header('Content-Type: text/xml; charset=UTF-8');
echo $spell->toXML();
```
Echoes Google-style XML like this:
```xmlThis Th's Thus Th HS
test tat ST St st```
... which you can use with your existing spell checking script such as GoogieSpell that was expecting XML structured data back from Google.
## Bugs/Suggestions
If you find a bug, or would like to contribute to the project please use the [Issue Tracker](https://github.com/AlphawolfWMP/google-spell-pspell/issues) over at my GitHub project page.
## Credits
Mad props to [Sabin Iacob (m0n5t3r)](http://m0n5t3r.info). Code basically from [here](http://plugins.svn.wordpress.org/ajax-spell-checker/trunk/service/spell-check-library.php), but I removed the Aspell and Google API parts and made it standalone-ready.