public class TextRecognizer extends APIRequestBase
Modifier and Type | Field and Description |
---|---|
static int |
RQ_DATA_INPUT_TYPE_FROM_SPEECH |
static int |
RQ_DATA_INPUT_TYPE_FROM_TEXT |
static java.lang.String |
RQ_DATA_TYPE_STT |
Constructor and Description |
---|
TextRecognizer(APIConfiguration configuration)
Text Recognizer to issue Natural Language Understanding API requests.
|
Modifier and Type | Method and Description |
---|---|
APIResponse |
requestNLI(java.lang.String text)
Request Natural Language Interaction service by specified input text.
|
APIResponse |
requestNLI(java.lang.String text,
NLIConfig nliConfig)
Request Natural Language Interaction service by specified input text.
|
APIResponse |
requestWordSegmentation(java.lang.String text)
Request word segmentation analyze service by specified input text.
|
void |
setNLIDataInputType(int inputType)
Set NLI data input type.
|
getConfiguration, getEndUserIdentifier, getSdkType, getTimeout, setConfiguration, setEndUserIdentifier, setSdkType, setTimeout
public static final java.lang.String RQ_DATA_TYPE_STT
public static final int RQ_DATA_INPUT_TYPE_FROM_SPEECH
public static final int RQ_DATA_INPUT_TYPE_FROM_TEXT
public TextRecognizer(APIConfiguration configuration)
configuration
- - API configurations.public void setNLIDataInputType(int inputType)
inputType
- 0 for speech source, or 1 for text source.public APIResponse requestWordSegmentation(java.lang.String text) throws java.security.NoSuchAlgorithmException, java.io.IOException
text
- - The text to be analyzed.java.security.NoSuchAlgorithmException
- Failed to create signature.java.io.IOException
- HTTP connection failed, or other exceptions.public APIResponse requestNLI(java.lang.String text) throws java.security.NoSuchAlgorithmException, java.io.IOException
text
- - The text to be recognized.java.security.NoSuchAlgorithmException
- Failed to create signature.java.io.IOException
- HTTP connection failed, or other exceptions.public APIResponse requestNLI(java.lang.String text, NLIConfig nliConfig) throws java.security.NoSuchAlgorithmException, java.io.IOException
text
- - The text to be recognized.nliConfig
- - NLIConfig object.java.security.NoSuchAlgorithmException
- Failed to create signature.java.io.IOException
- HTTP connection failed, or other exceptions.