batchDetectDominantLanguage method

Future<BatchDetectDominantLanguageResponse> batchDetectDominantLanguage({
  1. required List<String> textList,
})

Determines the dominant language of the input text for a batch of documents. For a list of languages that Amazon Comprehend can detect, see Amazon Comprehend Supported Languages.

May throw InvalidRequestException. May throw TextSizeLimitExceededException. May throw BatchSizeLimitExceededException. May throw InternalServerException.

Parameter textList : A list containing the text of the input documents. The list can contain a maximum of 25 documents. Each document should contain at least 20 characters and must contain fewer than 5,000 bytes of UTF-8 encoded characters.

Implementation

Future<BatchDetectDominantLanguageResponse> batchDetectDominantLanguage({
  required List<String> textList,
}) async {
  ArgumentError.checkNotNull(textList, 'textList');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Comprehend_20171127.BatchDetectDominantLanguage'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'TextList': textList,
    },
  );

  return BatchDetectDominantLanguageResponse.fromJson(jsonResponse.body);
}