in source/src/main/java/com/amazonaws/comprehend/esproxy/lambda/processor/operations/DetectSyntax.java [65:82]
public BatchResponse sendBatchRequest(@NonNull final List<BatchFieldLocator> fieldLocatorList,
@NonNull final List<String> contentList,
@NonNull final LanguageCode languageCode,
@NonNull final AmazonComprehend comprehendClient) {
BatchDetectSyntaxRequest request
= new BatchDetectSyntaxRequest().withTextList(contentList).withLanguageCode(languageCode.toString());
BatchDetectSyntaxResult batchDetectSyntaxResult = comprehendClient.batchDetectSyntax(request);
List<JSONObject> flattenedSyntaxList = new ArrayList<>();
for (BatchDetectSyntaxItemResult resultItem : batchDetectSyntaxResult.getResultList()) {
flattenedSyntaxList.add(flattenSyntaxList(resultItem.getSyntaxTokens()));
}
return new BatchResponse<>(
fieldLocatorList,
batchDetectSyntaxResult.getResultList(),
batchDetectSyntaxResult.getErrorList(), flattenedSyntaxList);
}