PHP code example of wisembly / semantria-php

1. Go to this page and download the library: Download wisembly/semantria-php 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/ */

    

wisembly / semantria-php example snippets



pplication code...


use Semantria\SemantriaAuthClient;

$semantria = SemantriaAuthClient::factory(array(
    'consumer_key'      => 'my-consumer-key',
    'consumer_secret'   => 'my-consumer-secret',
    'application_name'  => 'my-app',
    'use_compression'   => false
));

$semantria->addDocument([
    'id'    => 'foo',
    'text'  => 'This method queues document onto the server for analysis. Queued document analyzes individually and will have its own set of results. If unique configuration ID provided, Semantria uses settings of that configuration during analysis, in opposite the primary configuration uses. Document IDs are unique in scope of configuration. If the same ID appears twice, Semantria overrides existing document with the new Data.'
]);

$semantria->getDocument(['document_id' => 'foo']);