Package net.sf.okapi.connectors.google
Interface GoogleMTAPI
-
- All Known Implementing Classes:
GoogleMTAPIImpl
public interface GoogleMTAPI
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<String>getLanguages()<T> List<TranslationResponse>translate(GoogleQueryBuilder<T> qb)Make a single call to Google to translate the provided list of source texts.<T> TranslationResponsetranslateSingleSegment(GoogleQueryBuilder<T> qb, String sourceText)Perform translation of oversized (> 2048 characters) segments.
-
-
-
Method Detail
-
translate
<T> List<TranslationResponse> translate(GoogleQueryBuilder<T> qb) throws IOException, org.json.simple.parser.ParseException
Make a single call to Google to translate the provided list of source texts. The source texts must obey Google protocol limits of <= 2048 total characters per request.- Throws:
IOExceptionorg.json.simple.parser.ParseException
-
translateSingleSegment
<T> TranslationResponse translateSingleSegment(GoogleQueryBuilder<T> qb, String sourceText) throws IOException, org.json.simple.parser.ParseException
Perform translation of oversized (> 2048 characters) segments.- Returns:
- the translation response
- Throws:
IOExceptionorg.json.simple.parser.ParseException
-
getLanguages
List<String> getLanguages() throws IOException, org.json.simple.parser.ParseException
- Throws:
IOExceptionorg.json.simple.parser.ParseException
-
-