Search in sources :

Example 26 with Word

use of com.ibm.watson.developer_cloud.speech_to_text.v1.model.Word in project java-sdk by watson-developer-cloud.

the class CustomizationsTest method instantiateWords.

private static List<Word> instantiateWords() {
    Word word = new Word();
    word.setWord("hodor");
    word.setTranslation("hold the door");
    return ImmutableList.of(word);
}
Also used : Word(com.ibm.watson.developer_cloud.text_to_speech.v1.model.Word)

Example 27 with Word

use of com.ibm.watson.developer_cloud.speech_to_text.v1.model.Word in project java-sdk by watson-developer-cloud.

the class SpeechToText method getWord.

/**
 * Lists a custom word from a custom language model.
 *
 * Lists information about a custom word from a custom language model. You must use credentials for the instance of
 * the service that owns a model to query information about its words.
 *
 * @param getWordOptions the {@link GetWordOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of {@link Word}
 */
public ServiceCall<Word> getWord(GetWordOptions getWordOptions) {
    Validator.notNull(getWordOptions, "getWordOptions cannot be null");
    String[] pathSegments = { "v1/customizations", "words" };
    String[] pathParameters = { getWordOptions.customizationId(), getWordOptions.wordName() };
    RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
    return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Word.class));
}
Also used : Word(com.ibm.watson.developer_cloud.speech_to_text.v1.model.Word) RequestBuilder(com.ibm.watson.developer_cloud.http.RequestBuilder)

Aggregations

Test (org.junit.Test)19 Word (com.ibm.watson.developer_cloud.text_to_speech.v1.model.Word)16 WatsonServiceUnitTest (com.ibm.watson.developer_cloud.WatsonServiceUnitTest)10 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)10 WatsonServiceTest (com.ibm.watson.developer_cloud.WatsonServiceTest)9 MockResponse (okhttp3.mockwebserver.MockResponse)8 AddWordsOptions (com.ibm.watson.developer_cloud.text_to_speech.v1.model.AddWordsOptions)6 ListWordsOptions (com.ibm.watson.developer_cloud.text_to_speech.v1.model.ListWordsOptions)6 Words (com.ibm.watson.developer_cloud.text_to_speech.v1.model.Words)6 ByteString (okio.ByteString)6 ListWordsOptions (com.ibm.watson.developer_cloud.speech_to_text.v1.model.ListWordsOptions)5 Word (com.ibm.watson.developer_cloud.speech_to_text.v1.model.Word)5 Words (com.ibm.watson.developer_cloud.speech_to_text.v1.model.Words)5 AddWordOptions (com.ibm.watson.developer_cloud.text_to_speech.v1.model.AddWordOptions)5 JsonObject (com.google.gson.JsonObject)4 GetWordOptions (com.ibm.watson.developer_cloud.text_to_speech.v1.model.GetWordOptions)4 Translation (com.ibm.watson.developer_cloud.text_to_speech.v1.model.Translation)4 JsonParser (com.google.gson.JsonParser)3 AddWordOptions (com.ibm.watson.developer_cloud.speech_to_text.v1.model.AddWordOptions)3 CustomWord (com.ibm.watson.developer_cloud.speech_to_text.v1.model.CustomWord)3