PHPackages                             glicer/spell-checker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. glicer/spell-checker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

glicer/spell-checker
====================

Spell check html files

71202PHP

Since Oct 30Pushed 9y ago1 watchersCompare

[ Source](https://github.com/emmanuelroecker/php-spellchecker)[ Packagist](https://packagist.org/packages/glicer/spell-checker)[ RSS](/packages/glicer-spell-checker/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

php-spellchecker
================

[](#php-spellchecker)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/075786a2ec1a1c1a3803c03e9baf74b09897fa712bdd805093275d42561c99c9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656d6d616e75656c726f65636b65722f7068702d7370656c6c636865636b65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/emmanuelroecker/php-spellchecker/?branch=master)[![Build Status](https://camo.githubusercontent.com/34cc09725263010104c0e345142bbc7ad640b7f38097830425d22ac4be025795/68747470733a2f2f7472617669732d63692e6f72672f656d6d616e75656c726f65636b65722f7068702d7370656c6c636865636b65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/emmanuelroecker/php-spellchecker)[![Coverage Status](https://camo.githubusercontent.com/85164268a39811526e8d1100676069d294df6a80f38307bccae203bfa7b899d6/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f656d6d616e75656c726f65636b65722f7068702d7370656c6c636865636b65722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/emmanuelroecker/php-spellchecker?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/9920c1d3cf9033f07cd811140d5dfe3ef7a47621bdf6d76c485894f45af37894/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f66323032323435342d396463382d343234642d386231392d3037363464636335623764312f6d696e692e706e67)](https://insight.sensiolabs.com/projects/f2022454-9dc8-424d-8b19-0764dcc5b7d1)[![Dependency Status](https://camo.githubusercontent.com/7e20734be2df868839142b6bc0a0537c491ee19667637fe1469f17c6a495ec73/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3537633137383233393638643634303033393531363961322f62616467652e7376673f7374796c653d666c61742d737175617265)](https://www.versioneye.com/user/projects/57c17823968d6400395169a2)

Spell check html files

It's working with :

- [LanguageTool](https://www.languagetool.org/)
- [Guzzle](http://docs.guzzlephp.org)
- [Symfony Finder Component](http://symfony.com/doc/2.3/components/finder.html)
- [Glicer Simply-html Component](https://github.com/emmanuelroecker/php-simply-html)
- Optionally for spell suggestions : [Php Enchant](http://php.net/manual/en/book.enchant.php)

Install LanguageTool Server
---------------------------

[](#install-languagetool-server)

### Use Docker

[](#use-docker)

[Docker](http://www.docker.com/) must be installed

```
make docker_build
make docker_run
```

### Or use stand-alone

[](#or-use-stand-alone)

Java must be installed

Download and install [LanguageTool stand-alone for desktop](https://www.languagetool.org/) in a directory.

Enchant (Optionally for spell suggestions)
------------------------------------------

[](#enchant-optionally-for-spell-suggestions)

[PECL Enchant](http://pecl.php.net/package/enchant) can be used

```
sudo apt-get install php5.6-enchant
```

languages dictionnaries are in `dicts` dictionnary

Install php-spellchecker
------------------------

[](#install-php-spellchecker)

This library can be found on [Packagist](https://packagist.org/packages/glicer/spell-checker).

The recommended way to install is through [composer](http://getcomposer.org).

Edit your `composer.json` and add :

```
{
    "require": {
       "glicer/spell-checker": "dev-master"
    }
}
```

Install dependencies :

```
php composer.phar install
```

How to spell check html files ?
-------------------------------

[](#how-to-spell-check-html-files-)

```
require 'vendor/autoload.php';

use GlSpellChecker\GlSpellChecker;
use Symfony\Component\Finder\Finder;

//language to check, define languagetool directory, and languagetool port used
$spellchecker  = new GlSpellChecker("fr", "fr_FR","C:\\Glicer\\LanguageTool\\",'localhost', 8081);
// or with docker $spellchecker = new GlSpellChecker("fr","fr_FR",null,'localhost',8010);

//construct list of local html files to check spell
$finder = new Finder();
$files  = $finder->files()->in('./public')->name("*.html");

//launch html checking
$filereport = $spellchecker->checkHtmlFiles(
                                    $files,
                                        function (SplFileInfo $file, $nbrsentences) {
                                            // called at beginning - $nbr sentences to check
                                        },
                                        function ($sentence) {
                                            // called each sentence to check
                                        },
                                        function () {
                                            // called at the end
                                        }
            );

//$filereport contain fullpath to html file report
print_r($filereport);
```

you can view $filereport with your browser

How to spell check yaml files ?
-------------------------------

[](#how-to-spell-check-yaml-files-)

```
require 'vendor/autoload.php';

use GlSpellChecker\GlSpellChecker;
use Symfony\Component\Finder\Finder;

//define languagetool directory, language to check and languagetool port used
$spellchecker  = new GlSpellChecker("fr", "fr_FR","C:\\Glicer\\LanguageTool\\",'localhost',8081);
// or with docker $spellchecker = new GlSpellChecker("fr","fr_FR",null,'localhost',8010);

//construct list of local html files to check spell
$finder = new Finder();
$files  = $finder->files()->in('./public')->name("*.yml");

//launch html checking
$filereport = $spellchecker->checkYamlFiles(
                                    $files,
                                    ['test'], //list of fields to check
                                        function (SplFileInfo $file, $nbrsentences) {
                                            // called at beginning - $nbr sentences to check
                                        },
                                        function ($sentence) {
                                            // called each sentence to check
                                        },
                                        function () {
                                            // called at the end
                                        }
            );

//$filereport contain fullpath to html file report
print_r($filereport);
```

Running Tests
-------------

[](#running-tests)

Change LanguageTool in phpunit.xml.dist :

- ip/port if you use docker server
- directory if you use local server

Launch from command line :

```
vendor\bin\phpunit
```

License MIT
-----------

[](#license-mit)

Contact
-------

[](#contact)

Authors : Emmanuel ROECKER &amp; Rym BOUCHAGOUR

[Web Development Blog - http://dev.glicer.com](http://dev.glicer.com)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b48b243005db06852ef61705057d6bd36303e8e39d75191bb4c2c53c0823a2ea?d=identicon)[emmanuelroecker](/maintainers/emmanuelroecker)

### Embed Badge

![Health badge](/badges/glicer-spell-checker/health.svg)

```
[![Health](https://phpackages.com/badges/glicer-spell-checker/health.svg)](https://phpackages.com/packages/glicer-spell-checker)
```

###  Alternatives

[matildevoldsen/wire-comments

A Livewire package for adding comments to your Laravel application.

401.2k](/packages/matildevoldsen-wire-comments)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
