public class PredictAPIUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
CONTENT_CHAR_LIMIT
The maximum number of characters that can be translated in a single call to the predict endpoint.
|
| Constructor and Description |
|---|
PredictAPIUtil() |
| Modifier and Type | Method and Description |
|---|---|
String |
extractTranslation(InputStream is)
Extracts the translation from a stream containing the response body data.
|
List<org.json.simple.JSONObject> |
getPredictRequests(String sourceText)
Given source text of any length, constructs one or more JSONs that can be used as request bodies
for the predict endpoint.
|
public static final int CONTENT_CHAR_LIMIT
public List<org.json.simple.JSONObject> getPredictRequests(String sourceText)
public String extractTranslation(InputStream is) throws org.json.simple.parser.ParseException
org.json.simple.parser.ParseExceptionCopyright © 2019. All rights reserved.