This is a PHP library/wrapper of the NERD API. High level method calls that parse the JSON API response to PHP classes for ease of use.
Just copy the following files in your project:
- Folder: Domain
- Folder: WebResponse
- File: EFWebServiceManager.php
Method 2 relies on Packagist (https://packagist.org/)
{
"require": {
"hirmeos/entity-fishing-php-wrapper" : "*"
}
}
See the composer documentation here: https://packagist.org/ and here: https://getcomposer.org/doc/01-basic-usage.md#package-versions
Include: EFWebServiceManager.php in your file
require_once('EFWebServiceManager.php');
Disambiguate Text
EFWebServiceManager::disambiguateText(String searchText, String lang);
Returns object of type: EFDisambiguateTextWebResponse
Disambiguate Short Text
EFWebServiceManager::disambiguateShortText(String searchText, String lang);
Returns object of type: EFDisambiguateShortTextWebResponse
Disambiguate Term Vector
EFWebServiceManager::disambiguateTermVector(Array searchText, String lang);
Returns object of type: EFDisambiguateTermWebResponse
Disambiguate PDF
EFWebServiceManager::disambiguatePDF(String pdf_file_path, String lang);
Returns object of type: EFDisambiguatePDFWebResponse
Concept
EFWebServiceManager::concept(int concept_id, String lang);
Returns object of type: EFConceptWebResponse
Term
EFWebServiceManager::term(int term_id, String lang);
Returns object of type: EFTermWebResponse
Language
EFWebServiceManager::language(String text);
Returns object of type: EFLanguageWebResponse
Segmentation
EFWebServiceManager::segmentation(String text);
Returns object of type: EFSegmentationWebResponse
All response objects have the following three public variables:
public $has_error;
public $status_code;
public $error_msg;
Use the variables to check for API request errors before proceeding to the actual response data.