Skip to content

MartijnOud/LanguageTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Spellcheck with LanguageTool.org

Send a POST request to the Public HTTP API op (https://languagetool.org/)[LanguageTool.org] to check for common spelling mistakes. Can be used to create a Did You Mean... for your search function. This is what I use it for anyway.

Still in development, some known bugs, code documentation is still lacking.

<?php
require('languagetool.php');

$LanguageTool = new MartijnOud\LanguageTool('en-GB');

$query = 'quarantaine';
$strReplacement = $LanguageTool->check($query);
if (!empty($strReplacement)) {
    echo 'Did you mean: <em>'.$strReplacement.'</em>?'; // quarantine
}

$query = 'also works with full setences with multiple mistakes';
$strReplacement = $LanguageTool->check($query); // also works with full sentences with multiple mistakes

About

API wrapper for LanguageTool

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages