{"id":40,"date":"2020-01-31T03:37:11","date_gmt":"2020-01-31T03:37:11","guid":{"rendered":"https:\/\/cebucodesolutions.com\/blog\/?p=40"},"modified":"2020-01-31T03:37:11","modified_gmt":"2020-01-31T03:37:11","slug":"php-spellchecker-library","status":"publish","type":"post","link":"https:\/\/cebucodesolutions.com\/blog\/2020\/01\/31\/php-spellchecker-library\/","title":{"rendered":"PHP Spellchecker Library"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"519\" src=\"https:\/\/cebucodesolutions.com\/blog\/wp-content\/uploads\/2020\/01\/php-spellchecker-featured-1024x519.png\" alt=\"\" class=\"wp-image-41\" srcset=\"https:\/\/cebucodesolutions.com\/blog\/wp-content\/uploads\/2020\/01\/php-spellchecker-featured-1024x519.png 1024w, https:\/\/cebucodesolutions.com\/blog\/wp-content\/uploads\/2020\/01\/php-spellchecker-featured-300x152.png 300w, https:\/\/cebucodesolutions.com\/blog\/wp-content\/uploads\/2020\/01\/php-spellchecker-featured-768x389.png 768w, https:\/\/cebucodesolutions.com\/blog\/wp-content\/uploads\/2020\/01\/php-spellchecker-featured-1200x608.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p> PHP Spellchecker is a library providing a way to spellcheck multiple  sources of text by many spellcheckers. The library provides an  abstraction layer with a unified interface for various spellcheckers  with support for the following out of the box: <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/tigitz.github.io\/php-spellchecker\/docs\/spellcheckers\/aspell.html\">Aspell<\/a> <\/li><li><a href=\"https:\/\/tigitz.github.io\/php-spellchecker\/docs\/spellcheckers\/hunspell.html\">Hunspell<\/a> <\/li><li><a href=\"https:\/\/tigitz.github.io\/php-spellchecker\/docs\/spellcheckers\/ispell.html\">Ispell<\/a> <\/li><li><a href=\"https:\/\/tigitz.github.io\/php-spellchecker\/docs\/spellcheckers\/php-pspell.html\">PHP Pspell<\/a> <\/li><li><a href=\"https:\/\/tigitz.github.io\/php-spellchecker\/docs\/spellcheckers\/languagetools.html\">LanguageTools<\/a><\/li><li><a href=\"https:\/\/tigitz.github.io\/php-spellchecker\/docs\/spellcheckers\/multispellchecker.html\">MultiSpellchecker<\/a> <\/li><\/ul>\n\n\n\n<p> Here\u2019s a quick example from the documentation using the Aspell spellchecker: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nuse PhpSpellcheck\\SpellChecker\\Aspell;\n\n\/\/ if you made the default aspell installation on you local machine\n$aspell = Aspell::create();\n\n$misspellings = $aspell->check('mispell', ['en_US'], ['from_example']);\n\nforeach ($misspellings as $misspelling) {\n    $misspelling->getWord(); \/\/ 'mispell'\n    $misspelling->getLineNumber(); \/\/ '1'\n    $misspelling->getOffset(); \/\/ '0'\n    $misspelling->getSuggestions(); \/\/ ['misspell', ...]\n    $misspelling->getContext(); \/\/ ['from_example']\n}<\/code><\/pre>\n\n\n\n<p> Here\u2019s an example from the documentation for checking spelling in a file: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\/\/ spellchecking a file\n$misspellings = $aspell->check(new File('path\/to\/file.txt'), ['en_US'], ['from_file']);\nforeach ($misspellings as $misspelling) {\n    $misspelling->getWord();\n    $misspelling->getLineNumber();\n    $misspelling->getOffset();\n    $misspelling->getSuggestions();\n    $misspelling->getContext();\n}\n<\/code><\/pre>\n\n\n\n<p>\nBe sure to check out the <a href=\"https:\/\/tigitz.github.io\/php-spellchecker\/\">PHP-Spellchecker Documentation<\/a> for complete details on installation and usage. You can check out the source code on GitHub at <a href=\"https:\/\/github.com\/tigitz\/php-spellchecker\">tigitz\/php-spellchecker<\/a>.\n\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP Spellchecker is a library providing a way to spellcheck multiple sources of text by many spellcheckers. The library provides an abstraction layer with a unified interface for various spellcheckers with support for the following out of the box: Aspell Hunspell Ispell PHP Pspell LanguageTools MultiSpellchecker Here\u2019s a quick example from the documentation using the &hellip; <a href=\"https:\/\/cebucodesolutions.com\/blog\/2020\/01\/31\/php-spellchecker-library\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;PHP Spellchecker Library&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-40","post","type-post","status-publish","format-standard","hentry","category-updates"],"_links":{"self":[{"href":"https:\/\/cebucodesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cebucodesolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cebucodesolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cebucodesolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cebucodesolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=40"}],"version-history":[{"count":1,"href":"https:\/\/cebucodesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":42,"href":"https:\/\/cebucodesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/40\/revisions\/42"}],"wp:attachment":[{"href":"https:\/\/cebucodesolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cebucodesolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cebucodesolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}