Class GoogleAutoMLTranslationConnector
- java.lang.Object
-
- net.sf.okapi.lib.translation.BaseConnector
-
- net.sf.okapi.connectors.googleautoml.GoogleAutoMLTranslationConnector
-
- All Implemented Interfaces:
AutoCloseable,Iterator<QueryResult>,IQuery
public class GoogleAutoMLTranslationConnector extends BaseConnector
Connector for the Google AutoML Translation service.- See Also:
- AutoML Translation documentation
-
-
Constructor Summary
Constructors Constructor Description GoogleAutoMLTranslationConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this connector.StringgetName()Gets the name of the connector.GoogleAutoMLTranslationParametersgetParameters()Gets the current parameters of this connector.StringgetSettingsDisplay()Gets a display representation of the current settings for this connector.voidopen()Opens this query engine.intquery(String plainText)Starts a query for a give plain text.intquery(TextFragment sourceFragment)Starts a query for a given text.voidsetParameters(IParameters params)Sets the parameters for opening and querying this connector.-
Methods inherited from class net.sf.okapi.lib.translation.BaseConnector
batchLeverage, batchLeverageUsingBatchQuery, batchQuery, batchQueryText, clearAttributes, getNoQueryThreshold, getSourceLanguage, getTargetLanguage, getWeight, hasNext, leverage, leverageUsingBatchQuery, next, removeAttribute, setAttribute, setLanguages, setNoQueryThreshold, setRootDirectory, setWeight, toInternalCode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Method Detail
-
getParameters
public GoogleAutoMLTranslationParameters getParameters()
Description copied from interface:IQueryGets the current parameters of this connector.- Specified by:
getParametersin interfaceIQuery- Overrides:
getParametersin classBaseConnector- Returns:
- the current parameters of this connector or null if no parameters are used.
-
setParameters
public void setParameters(IParameters params)
Description copied from interface:IQuerySets the parameters for opening and querying this connector.- Specified by:
setParametersin interfaceIQuery- Overrides:
setParametersin classBaseConnector- Parameters:
params- the parameters to set.
-
getName
public String getName()
Description copied from interface:IQueryGets the name of the connector.- Returns:
- the name of the connector.
-
getSettingsDisplay
public String getSettingsDisplay()
Description copied from interface:IQueryGets a display representation of the current settings for this connector. This can be a display of some of the parameters for example, or some explanations about default non-modifiable settings.- Returns:
- a display representation of the current settings.
-
open
public void open()
Description copied from interface:IQueryOpens this query engine.
-
close
public void close()
Description copied from interface:IQueryCloses this connector.
-
query
public int query(String plainText)
Description copied from interface:IQueryStarts a query for a give plain text.- Parameters:
plainText- text to query.- Returns:
- The number of hits for the given query.
-
query
public int query(TextFragment sourceFragment)
Description copied from interface:IQueryStarts a query for a given text.- Parameters:
sourceFragment- The text to query.- Returns:
- The number of hits for the given query.
-
-