Check misspellings from any text source with the most popular PHP spellchecker.
PHP-Spellchecker is a spellchecker abstraction library for PHP. By providing a unified interface for many different spellcheckers, you’re able to swap out spellcheckers without extensive rewrites.
Using PHP-Spellchecker can eliminate vendor-lock in, reduce technical debt, and improve the testability of your code.
PHP-Spellchecker is a welcoming project for new contributors.
Want to make your first open source contribution? Check the roadmap, pick one task, open an issue and we'll help you go through it 🤓🚀
Project is still in it's initial phase, requiring more real life usage to stabilize it's final 1.0.0 API.
- [ ] Add a CLI that could do something like
vendor/bin/php-spellchecker "misspell" Languagetools EchoHandler --lang=en_US
- [ ] Add asynchronous mechanism to spellcheckers
- [ ] Make some computed misspelling properties optional to improve performance for certain use cases (e.g., lines and offset in
- [ ] Add a languages mapper to manage different representations across spellcheckers
- [ ] Evaluate
strtok instead of
explode to parse lines of text, for performance
- [ ] Evaluate
MutableMisspelling for performance comparison
- [ ] Wrap
Webmozart/Assert library exceptions to throw PHP-Spellchecker custom exceptions instead
- [ ] Improve the
- [ ] Make a
SourceInterface class that's able to have an effect on the used spellchecker configuration
- [ ] League/Flysystem source
- [ ] Symfony/Finder source
- [ ] Markdown - Find a way to keep original offset and line of words after stripping
- [ ] Add PHPDoc processor
- [ ] Add HTML Processor (inspiration)
- [ ] Add XLIFF Processor (inspiration)
- [ ] Cache suggestions of already spellchecked words (PSR-6/PSR-16?)
- [ ] Pspell - Find way to compute word offset
- [ ] LanguageTools - Evaluate HTTPlug library to make API requests
- [ ] Pspell - find way to list available dictionaries
- [ ] Add JamSpell spellchecker
- [ ] Add NuSpell spellchecker
- [ ] Add SymSpell spellchecker
- [ ] MonologHandler
- [ ] ChainedHandler
- [ ] HTMLReportHandler
- [ ] XmlReportHandler
- [ ] JSONReportHandler
- [ ] ConsoleTableHandler
- [ ] Add or improve tests with different text encoding
- [ ] Refactor duplicate Dockerfile content between PHP images
We follow SemVer v2.0.0.
There still are many design decisions that should be confronted with real-world usage before thinking about a v1.0.0 stable release:
MisspellingInterface really useful?
- Is using generators the right way to go?
- Should all the contributed spellcheckers be maintained by the package itself?
- How to design an intuitive CLI given the needed flexibility of usage?
- Is the "context" array passed through all the layers the right design to handle data sharing?
Please see CONTRIBUTING.
The MIT License (MIT). Please see License File for more information.
Elements taken for the final rendering are Designed by rawpixel.com / Freepik