/** * Delete a custom word. * * Deletes a custom word from a custom language model. You can remove any word that you added to the custom model's * words resource via any means. However, if the word also exists in the service's base vocabulary, the service * removes only the custom pronunciation for the word; the word remains in the base vocabulary. Removing a custom word * does not affect the custom model until you train the model with the **Train a custom language model** method. You * must use credentials for the instance of the service that owns a model to delete its words. * * **See also:** [Deleting a word from a custom language * model](https://cloud.ibm.com/docs/services/speech-to-text/language-words.html#deleteWord). * * @param deleteWordOptions the {@link DeleteWordOptions} containing the options for the call * @return a {@link ServiceCall} with a response type of Void */ public ServiceCall<Void> deleteWord(DeleteWordOptions deleteWordOptions) { Validator.notNull(deleteWordOptions, "deleteWordOptions cannot be null"); String[] pathSegments = { "v1/customizations", "words" }; String[] pathParameters = { deleteWordOptions.customizationId(), deleteWordOptions.wordName() }; RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters)); return createServiceCall(builder.build(), ResponseConverterUtils.getVoid()); }
/** * Delete a custom word. * * Deletes a custom word from a custom language model. You can remove any word that you added to the custom model's * words resource via any means. However, if the word also exists in the service's base vocabulary, the service * removes only the custom pronunciation for the word; the word remains in the base vocabulary. Removing a custom word * does not affect the custom model until you train the model with the **Train a custom language model** method. You * must use credentials for the instance of the service that owns a model to delete its words. * * **See also:** [Deleting a word from a custom language * model](https://cloud.ibm.com/docs/services/speech-to-text/language-words.html#deleteWord). * * @param deleteWordOptions the {@link DeleteWordOptions} containing the options for the call * @return a {@link ServiceCall} with a response type of Void */ public ServiceCall<Void> deleteWord(DeleteWordOptions deleteWordOptions) { Validator.notNull(deleteWordOptions, "deleteWordOptions cannot be null"); String[] pathSegments = { "v1/customizations", "words" }; String[] pathParameters = { deleteWordOptions.customizationId(), deleteWordOptions.wordName() }; RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters)); builder.header("X-IBMCloud-SDK-Analytics", "service_name=speech_to_text;service_version=v1;operation_id=deleteWord"); return createServiceCall(builder.build(), ResponseConverterUtils.getVoid()); }