public class ToneAnalyzer extends WatsonService
| Modifier and Type | Field and Description |
|---|---|
static String |
CONTEXT |
static String |
HOPS |
static String |
LIMIT |
static String |
SCORECARD |
static String |
TEXT |
static String |
TRAITS |
static String |
WORDS |
| Constructor and Description |
|---|
ToneAnalyzer()
Instantiates a new Tone Analyzer service with the default url
|
| Modifier and Type | Method and Description |
|---|---|
List<SynonymResult> |
getSynonyms(Map<String,Object> params)
Starts or continue conversations.
|
Tone |
getTone(String text)
Analyzes the "tone" of a piece of text using the default scorecard.
|
Tone |
getTone(String text,
Scorecard scorecard)
Analyzes the "tone" of a piece of text.
|
execute, executeWithoutResponse, getApiKey, getDefaultContentType, getDefaultRequestParams, getEndPoint, getGson, getHttpClient, getThreadSafeClient, setApiKey, setEndPoint, setUsernameAndPassword, toStringpublic static final String HOPS
public static final String LIMIT
public static final String CONTEXT
public static final String TRAITS
public static final String WORDS
public static final String TEXT
public static final String SCORECARD
public ToneAnalyzer()
public Tone getTone(String text)
text - The text to analyzeTone with the responsepublic Tone getTone(String text, Scorecard scorecard)
text - The text to analyzescorecard - Name of the scorecard used to compute the tone. (business
messages by default)Tone with the responsepublic List<SynonymResult> getSynonyms(Map<String,Object> params)
words - (string[]),traits - (string[], optional),limit - (long, optional) Limits the number of words to return on each
trait. The most heavily correlated (positive and negative) to
each trait are returned; approximately limit/2 each of
positively correlated words negatively correlated words if
there are enough available.hops - (long, optional): The number of 'hops' to explore for synonyms
or related words: 0 indicates words directly related to the
input; 1 gives words related to them, and so on. The greater
this number, the richer the word set returned (but at the same
time, less tightly related to the input).context - (string[], optional)index - (long, optional): The position (0-based) in `context`
parameter where the requested word appears. This parameter can
only be passed when `context` is also present and there is
only one word requested (length(`words`)=0), and it makes
sense only if `context[index]` is equal to `words[0]`.params - The map with the parameters described aboveSynonymResultCopyright © 2015. All rights reserved.