Package com.basistech.rosette.examples
Class ExampleBase
java.lang.Object
com.basistech.rosette.examples.ExampleBase
- Direct Known Subclasses:
AddressSimilarityExample,CategoriesExample,EntitiesExample,EventsExample,InfoExample,LanguageExample,LanguageMultilingualExample,MorphologyCompleteExample,MorphologyCompoundComponentsExample,MorphologyHanReadingsExample,MorphologyLemmasExample,MorphologyPartsOfSpeechExample,NameDeduplicationExample,NameSimilarityExample,NameTranslationExample,PingExample,RelationshipsExample,SemanticVectorsExample,SentencesExample,SentimentExample,SimilarTermsExample,SyntaxDependenciesExample,TokensExample,TopicsExample,TransliterationExample
Provides examples on how to use the
HttpRosetteAPI-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected Stringprotected static StringresponseToJson(com.basistech.rosette.apimodel.Response response) Converts a response to JSON stringprotected static voidshowUsage(Class<? extends ExampleBase> commandClass) Prints out how to run the program
-
Constructor Details
-
ExampleBase
public ExampleBase()
-
-
Method Details
-
getApiKeyFromSystemProperty
- Returns:
- api key using system property "rosette.api.key"
-
getAltUrlFromSystemProperty
- Returns:
- alternate url using system property "rosette.api.altUrl"
-
showUsage
Prints out how to run the program- Parameters:
commandClass- the class to use in the usage message.
-
responseToJson
protected static String responseToJson(com.basistech.rosette.apimodel.Response response) throws com.fasterxml.jackson.core.JsonProcessingException Converts a response to JSON string- Parameters:
response-Responsefrom RosetteAPI- Returns:
- the json string.
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if the Jackson library throws an error serializing.
-