Class AddGrammarOptions
- All Implemented Interfaces:
com.ibm.cloud.sdk.core.service.model.ObjectModel
public class AddGrammarOptions
extends com.ibm.cloud.sdk.core.service.model.GenericModel
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AddGrammarOptions.Builder
Builder. -
Method Summary
Modifier and Type Method Description Boolean
allowOverwrite()
Gets the allowOverwrite.String
contentType()
Gets the contentType.String
customizationId()
Gets the customizationId.InputStream
grammarFile()
Gets the grammarFile.String
grammarName()
Gets the grammarName.AddGrammarOptions.Builder
newBuilder()
New builder.Methods inherited from class com.ibm.cloud.sdk.core.service.model.GenericModel
equals, hashCode, toString
-
Method Details
-
newBuilder
New builder.- Returns:
- a AddGrammarOptions builder
-
customizationId
Gets the customizationId.The customization ID (GUID) of the custom language model that is to be used for the request. You must make the request with credentials for the instance of the service that owns the custom model.
- Returns:
- the customizationId
-
grammarName
Gets the grammarName.The name of the new grammar for the custom language model. Use a localized name that matches the language of the custom model and reflects the contents of the grammar. * Include a maximum of 128 characters in the name. * Do not use characters that need to be URL-encoded. For example, do not use spaces, slashes, backslashes, colons, ampersands, double quotes, plus signs, equals signs, questions marks, and so on in the name. (The service does not prevent the use of these characters. But because they must be URL-encoded wherever used, their use is strongly discouraged.) * Do not use the name of an existing grammar or corpus that is already defined for the custom model. * Do not use the name `user`, which is reserved by the service to denote custom words that are added or modified by the user. * Do not use the name `base_lm` or `default_lm`. Both names are reserved for future use by the service.
- Returns:
- the grammarName
-
grammarFile
Gets the grammarFile.A plain text file that contains the grammar in the format specified by the `Content-Type` header. Encode the file in UTF-8 (ASCII is a subset of UTF-8). Using any other encoding can lead to issues when compiling the grammar or to unexpected results in decoding. The service ignores an encoding that is specified in the header of the grammar.
With the `curl` command, use the `--data-binary` option to upload the file for the request.
- Returns:
- the grammarFile
-
contentType
Gets the contentType.The format (MIME type) of the grammar file: * `application/srgs` for Augmented Backus-Naur Form (ABNF), which uses a plain-text representation that is similar to traditional BNF grammars. * `application/srgs+xml` for XML Form, which uses XML elements to represent the grammar.
- Returns:
- the contentType
-
allowOverwrite
Gets the allowOverwrite.If `true`, the specified grammar overwrites an existing grammar with the same name. If `false`, the request fails if a grammar with the same name already exists. The parameter has no effect if a grammar with the same name does not already exist.
- Returns:
- the allowOverwrite
-