Class GoogleMTv3Connector
- java.lang.Object
-
- net.sf.okapi.lib.translation.BaseConnector
-
- net.sf.okapi.connectors.google.v3.GoogleMTv3Connector
-
- All Implemented Interfaces:
AutoCloseable,Iterator<net.sf.okapi.common.query.QueryResult>,net.sf.okapi.common.query.IQuery
public class GoogleMTv3Connector extends net.sf.okapi.lib.translation.BaseConnectorConnector for Google Cloud Translation API v3 with glossary support.
-
-
Constructor Summary
Constructors Constructor Description GoogleMTv3Connector()GoogleMTv3Connector(GoogleMTv3API api)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbatchLeverage(List<net.sf.okapi.common.resource.ITextUnit> tuList)List<List<net.sf.okapi.common.query.QueryResult>>batchQuery(List<net.sf.okapi.common.resource.TextFragment> fragments)List<List<net.sf.okapi.common.query.QueryResult>>batchQueryText(List<String> plainTexts)voidclose()StringgetName()GoogleMTv3ParametersgetParameters()StringgetSettingsDisplay()List<net.sf.okapi.common.LocaleId>getSupportedLanguages()voidleverage(net.sf.okapi.common.resource.ITextUnit tu)voidopen()intquery(String plainText)intquery(net.sf.okapi.common.resource.TextFragment frag)voidsetParameters(net.sf.okapi.common.IParameters params)-
Methods inherited from class net.sf.okapi.lib.translation.BaseConnector
clearAttributes, getNoQueryThreshold, getSourceLanguage, getTargetLanguage, getWeight, hasNext, next, removeAttribute, setAttribute, setLanguages, setNoQueryThreshold, setRootDirectory, setWeight
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
GoogleMTv3Connector
public GoogleMTv3Connector()
-
GoogleMTv3Connector
public GoogleMTv3Connector(GoogleMTv3API api)
-
-
Method Detail
-
setParameters
public void setParameters(net.sf.okapi.common.IParameters params)
- Specified by:
setParametersin interfacenet.sf.okapi.common.query.IQuery- Overrides:
setParametersin classnet.sf.okapi.lib.translation.BaseConnector
-
getParameters
public GoogleMTv3Parameters getParameters()
- Specified by:
getParametersin interfacenet.sf.okapi.common.query.IQuery- Overrides:
getParametersin classnet.sf.okapi.lib.translation.BaseConnector
-
close
public void close()
-
getName
public String getName()
-
getSettingsDisplay
public String getSettingsDisplay()
-
open
public void open()
-
query
public int query(String plainText)
-
query
public int query(net.sf.okapi.common.resource.TextFragment frag)
-
batchQueryText
public List<List<net.sf.okapi.common.query.QueryResult>> batchQueryText(List<String> plainTexts)
- Specified by:
batchQueryTextin interfacenet.sf.okapi.common.query.IQuery- Overrides:
batchQueryTextin classnet.sf.okapi.lib.translation.BaseConnector
-
batchQuery
public List<List<net.sf.okapi.common.query.QueryResult>> batchQuery(List<net.sf.okapi.common.resource.TextFragment> fragments)
- Specified by:
batchQueryin interfacenet.sf.okapi.common.query.IQuery- Overrides:
batchQueryin classnet.sf.okapi.lib.translation.BaseConnector
-
getSupportedLanguages
public List<net.sf.okapi.common.LocaleId> getSupportedLanguages()
-
leverage
public void leverage(net.sf.okapi.common.resource.ITextUnit tu)
- Specified by:
leveragein interfacenet.sf.okapi.common.query.IQuery- Overrides:
leveragein classnet.sf.okapi.lib.translation.BaseConnector
-
batchLeverage
public void batchLeverage(List<net.sf.okapi.common.resource.ITextUnit> tuList)
- Specified by:
batchLeveragein interfacenet.sf.okapi.common.query.IQuery- Overrides:
batchLeveragein classnet.sf.okapi.lib.translation.BaseConnector
-
-