Package com.basistech.rosette.api.common
Class AbstractRosetteAPI
java.lang.Object
com.basistech.rosette.api.common.AbstractRosetteAPI
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
HttpRosetteAPI
This class defines the common API to Analytics, whether over HTTP or other integration mechanisms.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract com.basistech.rosette.apimodel.SupportedLanguagePairsResponse
getSupportedLanguagePairs
(String endpoint) Gets the set of language, script codes and transliteration scheme pairs supported by the specified Analytics API endpoint.abstract com.basistech.rosette.apimodel.SupportedLanguagesResponse
getSupportedLanguages
(String endpoint) Gets the set of language and script codes supported by the specified Analytics API endpoint.abstract <RequestType extends com.basistech.rosette.apimodel.Request>
com.basistech.rosette.dm.AnnotatedTextPerform a request to an endpoint of the Analytics API.abstract <RequestType extends com.basistech.rosette.apimodel.Request,
ResponseType extends com.basistech.rosette.apimodel.Response>
ResponseTypePerform a request to an endpoint of the Analytics API.abstract <RequestType extends com.basistech.rosette.apimodel.Request,
ResponseType extends com.basistech.rosette.apimodel.Response>
Future<ResponseType> performAsync
(String endpoint, RequestType request, Class<ResponseType> responseClass) Start an asynchronous request to an endpoint of the Analytics API.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.AutoCloseable
close
-
Field Details
-
LANGUAGE_SERVICE_PATH
- See Also:
-
MORPHOLOGY_SERVICE_PATH
- See Also:
-
ENTITIES_SERVICE_PATH
- See Also:
-
CATEGORIES_SERVICE_PATH
- See Also:
-
RELATIONSHIPS_SERVICE_PATH
- See Also:
-
SENTIMENT_SERVICE_PATH
- See Also:
-
NAME_DEDUPLICATION_SERVICE_PATH
- See Also:
-
NAME_TRANSLATION_SERVICE_PATH
- See Also:
-
NAME_SIMILARITY_SERVICE_PATH
- See Also:
-
RECORD_SIMILARITY_SERVICE_PATH
- See Also:
-
ADDRESS_SIMILARITY_SERVICE_PATH
- See Also:
-
TOKENS_SERVICE_PATH
- See Also:
-
SENTENCES_SERVICE_PATH
- See Also:
-
TEXT_EMBEDDING_SERVICE_PATH
- See Also:
-
SEMANTIC_VECTORS_SERVICE_PATH
- See Also:
-
SIMILAR_TERMS_SERVICE_PATH
- See Also:
-
SYNTAX_DEPENDENCIES_SERVICE_PATH
- See Also:
-
TRANSLITERATION_SERVICE_PATH
- See Also:
-
TOPICS_SERVICE_PATH
- See Also:
-
INFO_SERVICE_PATH
- See Also:
-
PING_SERVICE_PATH
- See Also:
-
SUPPORTED_LANGUAGES_SUBPATH
- See Also:
-
EVENTS_SERVICE_PATH
- See Also:
-
DOC_ENDPOINTS
-
NAMES_ENDPOINTS
-
-
Constructor Details
-
AbstractRosetteAPI
public AbstractRosetteAPI()
-
-
Method Details
-
getSupportedLanguages
public abstract com.basistech.rosette.apimodel.SupportedLanguagesResponse getSupportedLanguages(String endpoint) throws com.basistech.rosette.apimodel.CommonRosetteAPIException Gets the set of language and script codes supported by the specified Analytics API endpoint.- Parameters:
endpoint
- Analytics API endpoint.- Returns:
- SupportedLanguagesResponse
- Throws:
com.basistech.rosette.apimodel.CommonRosetteAPIException
- for an error.
-
getSupportedLanguagePairs
public abstract com.basistech.rosette.apimodel.SupportedLanguagePairsResponse getSupportedLanguagePairs(String endpoint) throws com.basistech.rosette.apimodel.CommonRosetteAPIException Gets the set of language, script codes and transliteration scheme pairs supported by the specified Analytics API endpoint.- Parameters:
endpoint
- Analytics API endpoint.- Returns:
- SupportedLanguagePairsResponse
- Throws:
com.basistech.rosette.apimodel.CommonRosetteAPIException
- for an error returned from the Rosette API.
-
perform
public abstract <RequestType extends com.basistech.rosette.apimodel.Request,ResponseType extends com.basistech.rosette.apimodel.Response> ResponseType perform(String endpoint, RequestType request, Class<ResponseType> responseClass) throws com.basistech.rosette.apimodel.CommonRosetteAPIException Perform a request to an endpoint of the Analytics API.- Type Parameters:
RequestType
- The class of the request object for this endpoint.ResponseType
- the class of the response object for this endpoint.- Parameters:
endpoint
- which endpoint.request
- the data for the request.responseClass
- the JavaClass
object for the response object.- Returns:
- the response.
- Throws:
com.basistech.rosette.apimodel.CommonRosetteAPIException
- for an error.
-
perform
public abstract <RequestType extends com.basistech.rosette.apimodel.Request> com.basistech.rosette.dm.AnnotatedText perform(String endpoint, RequestType request) throws com.basistech.rosette.apimodel.CommonRosetteAPIException Perform a request to an endpoint of the Analytics API.- Type Parameters:
RequestType
- The class of the request object for this endpoint.- Parameters:
endpoint
- which endpoint.request
- the data for the request.- Returns:
- the response,
AnnotatedText
. - Throws:
com.basistech.rosette.apimodel.CommonRosetteAPIException
- for an error.
-
performAsync
public abstract <RequestType extends com.basistech.rosette.apimodel.Request,ResponseType extends com.basistech.rosette.apimodel.Response> Future<ResponseType> performAsync(String endpoint, RequestType request, Class<ResponseType> responseClass) throws com.basistech.rosette.apimodel.CommonRosetteAPIException Start an asynchronous request to an endpoint of the Analytics API.- Type Parameters:
RequestType
- The class of the request object for this endpoint.ResponseType
- the class of the response object for this endpoint.- Parameters:
endpoint
- which endpoint.request
- the data for the request.responseClass
- the JavaClass
object for the response object.- Returns:
- a
Future
for the response. - Throws:
com.basistech.rosette.apimodel.CommonRosetteAPIException
- for an error.
-