public class MyMemoryTMConnector extends BaseConnector implements ITMQuery
| Modifier and Type | Field and Description |
|---|---|
static SimpleDateFormat |
sdfLong |
static SimpleDateFormat |
sdfShort |
| Constructor and Description |
|---|
MyMemoryTMConnector() |
| Modifier and Type | Method and Description |
|---|---|
List<List<QueryResult>> |
batchQuery(List<TextFragment> fragments)
Slow default implementation using query!!
Override to take advantage of servers batch API
|
void |
close()
Closes this connector.
|
int |
getMaximumHits()
Gets the current maximum number of hits to retrieve.
|
String |
getName()
Gets the name of the connector.
|
Parameters |
getParameters()
Gets the current parameters of this connector.
|
String |
getSettingsDisplay()
Gets a display representation of the current settings for this connector.
|
int |
getThreshold()
Gets the current threshold value to use for the query.
|
boolean |
hasNext()
Indicates of there is a hit available.
|
QueryResult |
next()
Gets the next hit for the last query.
|
void |
open()
Opens this query engine.
|
int |
query(String plainText)
Starts a query for a give plain text.
|
int |
query(TextFragment frag)
Starts a query for a given text.
|
void |
setMaximumHits(int max)
Sets the maximum number of hits to return.
|
void |
setParameters(IParameters params)
Sets the parameters for opening and querying this connector.
|
void |
setRootDirectory(String rootDir)
Sets the root directory that may be used to replace the available ${rootDir} in the
parameters of this object.
|
void |
setThreshold(int threshold)
Sets the threshold value to use for the query.
|
protected String |
toInternalCode(LocaleId locale)
Converts a locale identifier to the internal string value for a language/locale code for this connector.
|
batchLeverage, batchLeverageUsingBatchQuery, batchQueryText, clearAttributes, getNoQueryThreshold, getSourceLanguage, getTargetLanguage, getWeight, leverage, leverageUsingBatchQuery, removeAttribute, setAttribute, setLanguages, setNoQueryThreshold, setWeightclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbatchLeverage, batchQueryText, clearAttributes, getNoQueryThreshold, getSourceLanguage, getTargetLanguage, getWeight, leverage, removeAttribute, setAttribute, setLanguages, setNoQueryThreshold, setWeightforEachRemaining, removepublic static final SimpleDateFormat sdfShort
public static final SimpleDateFormat sdfLong
public String getName()
IQuerypublic String getSettingsDisplay()
IQuerygetSettingsDisplay in interface IQuerypublic void close()
IQueryclose in interface AutoCloseableclose in interface IQuerypublic boolean hasNext()
IQueryhasNext in interface Iterator<QueryResult>hasNext in interface IQueryhasNext in class BaseConnectorpublic QueryResult next()
IQuerynext in interface Iterator<QueryResult>next in interface IQuerynext in class BaseConnectorpublic void open()
IQuerypublic int query(TextFragment frag)
IQuerypublic int query(String plainText)
IQuerypublic List<List<QueryResult>> batchQuery(List<TextFragment> fragments)
BaseConnectorbatchQuery in interface IQuerybatchQuery in class BaseConnectorfragments - list of the text fragments to translate.protected String toInternalCode(LocaleId locale)
BaseConnectortoInternalCode in class BaseConnectorlocale - the locale identifier to convert.public void setMaximumHits(int max)
setMaximumHits in interface ITMQuerymax - The maximum number of hits to retrieve.public void setThreshold(int threshold)
ITMQuerysetThreshold in interface ITMQuerythreshold - The threshold value (between 0 and 100).public int getMaximumHits()
ITMQuerygetMaximumHits in interface ITMQuerypublic int getThreshold()
ITMQuerygetThreshold in interface ITMQuerypublic Parameters getParameters()
IQuerygetParameters in interface IQuerygetParameters in class BaseConnectorpublic void setParameters(IParameters params)
IQuerysetParameters in interface IQuerysetParameters in class BaseConnectorparams - the parameters to set.public void setRootDirectory(String rootDir)
IQuerysetRootDirectory in interface IQuerysetRootDirectory in class BaseConnectorrootDir - the root directory.Copyright © 2022. All rights reserved.