2025-01-20 14:14:44 +01:00
|
|
|
<?PHP
|
|
|
|
/**
|
|
|
|
* Provides the API.
|
|
|
|
*/
|
|
|
|
declare(strict_types = 1);
|
|
|
|
|
|
|
|
require_once __DIR__ . '/../provideEnv.php';
|
|
|
|
|
2025-01-22 15:10:59 +01:00
|
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
|
|
|
2025-01-20 14:14:44 +01:00
|
|
|
$verb = MD_STD_IN::get_http_input_text("verb");
|
|
|
|
$subject = MD_STD_IN::get_http_input_text("subject");
|
|
|
|
|
2025-01-22 15:10:59 +01:00
|
|
|
$output = match ($verb) {
|
|
|
|
'evaluate' => (new ConcordanceChecker($subject))->evaluate(explode(PHP_EOL, $_POST['terms'] ?? $_GET['terms'] ?? [])),
|
|
|
|
default => throw new MDpageParameterNotFromListException(),
|
|
|
|
};
|
2025-01-20 14:14:44 +01:00
|
|
|
|
2025-01-22 15:10:59 +01:00
|
|
|
echo MD_STD::json_encode($output);
|