1. Go to this page and download the library: Download ollieparsley/corticalio library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$client = new \Corticalio\Client([
'api_key' => 'MY_API_KEY',
]);
echo "List terms: \n";
print_r($client->terms->listTerms('en_associative'));
echo "\n\n";
echo "Show term soccer using en_associative: \n";
print_r($client->terms->getTerm('en_associative', 'soccer'));
echo "\n\n";
echo "Show term contexts for soccer using en_associative: \n";
print_r($client->terms->listTermContexts('en_associative', 'soccer'));
echo "\n\n";
echo "Show similar terms to soccer using en_associative: \n";
print_r($client->terms->listSimilarTerms('en_associative', 'soccer'));
echo "\n\n";
$client = new \Corticalio\Client([
'api_key' => 'MY_API_KEY',
]);
echo "Compare 2 elements using en_associative: \n";
$element1 = new \Corticalio\Model\ExpressionElement();
$element1->text = 'Manchester City lost the football match';
$element2 = new \Corticalio\Model\ExpressionElement();
$element2->text = 'Manchester United won the football match';
print_r($client->compare->compare('en_associative', $element1, $element2));
echo "\n\n";
echo "Bulk compare element pairs en_associative: \n";
$elementPairs = new \Corticalio\Model\ExpressionElementArray();
$elementPairs->addPair($element1, $element2);
$elementPairs->addPair($element2, $element1);
print_r($client->compare->bulkCompare('en_associative', $elementPairs));
echo "\n\n";
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.