batchDetectSyntax method
- required SyntaxLanguageCode languageCode,
- required List<
String> textList,
Inspects the text of a batch of documents for the syntax and part of speech of the words in the document and returns information about them. For more information, see how-syntax.
May throw InvalidRequestException. May throw TextSizeLimitExceededException. May throw UnsupportedLanguageException. May throw BatchSizeLimitExceededException. May throw InternalServerException.
Parameter languageCode
:
The language of the input documents. You can specify any of the following
languages supported by Amazon Comprehend: German ("de"), English ("en"),
Spanish ("es"), French ("fr"), Italian ("it"), or Portuguese ("pt"). All
documents must be in the same language.
Parameter textList
:
A list containing the text of the input documents. The list can contain a
maximum of 25 documents. Each document must contain fewer that 5,000 bytes
of UTF-8 encoded characters.
Implementation
Future<BatchDetectSyntaxResponse> batchDetectSyntax({
required SyntaxLanguageCode languageCode,
required List<String> textList,
}) async {
ArgumentError.checkNotNull(languageCode, 'languageCode');
ArgumentError.checkNotNull(textList, 'textList');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Comprehend_20171127.BatchDetectSyntax'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'LanguageCode': languageCode.toValue(),
'TextList': textList,
},
);
return BatchDetectSyntaxResponse.fromJson(jsonResponse.body);
}