public ServiceCall<Void> addTextToCustomizationCorpus(String customizationId,String corpusName,Boolean allowOverride,File trainingData){
  Validator.notNull(customizationId,"customizationId cannot be null");
  Validator.notNull(corpusName,"corpusName cannot be null");
  Validator.isTrue((trainingData != null) && trainingData.exists(),"trainingData file is null or does not exist");
  RequestBuilder requestBuilder=RequestBuilder.post(String.format(PATH_CORPUS,customizationId,corpusName));
  if (allowOverride != null) {
    requestBuilder.query(ALLOW_OVERRIDE,allowOverride);
  }
  requestBuilder.body(RequestBody.create(HttpMediaType.TEXT,trainingData));
  return createServiceCall(requestBuilder.build(),ResponseConverterUtils.getVoid());
}

public ServiceCall < Void > addTextToCustomizationCorpus ( String customizationId , String corpusName , Boolean allowOverride , File trainingData ) { Validator . notNull ( customizationId , "customizationId cannot be null" ) ; Validator . notNull ( corpusName , "corpusName cannot be null" ) ; Validator . isTrue ( ( trainingData != null ) && trainingData . exists ( ) , "trainingData file is null or does not exist" ) ; RequestBuilder requestBuilder = RequestBuilder . post ( String . format ( PATH_CORPUS , customizationId , corpusName ) ) ; if ( allowOverride != null ) { requestBuilder . query ( ALLOW_OVERRIDE , allowOverride ) ; } requestBuilder . body ( RequestBody . create ( HttpMediaType . TEXT , trainingData ) ) ; return createServiceCall ( requestBuilder . build ( ) , ResponseConverterUtils . getVoid ( ) ) ; }
adds a single corpus text file of new training data to the custom language model . use multiple requests to submit multiple corpus text files . only the owner of a custom model can use this method to add a corpus to the model . submit a plain text file that contains sample sentences from the domain of interest to enable the service to extract words in context . the more sentences you add that represent the context in which speakers use words from the domain , the better the service ' s recognition accuracy . adding a corpus does not affect the custom model until you train the model for the new data by using the post / v1 / customizations / { customization_id } / train method .
