Class BaseCachedTranslate
- java.lang.Object
-
- org.omegat.core.machinetranslators.BaseTranslate
-
- org.omegat.core.machinetranslators.BaseCachedTranslate
-
- All Implemented Interfaces:
IMachineTranslation
- Direct Known Subclasses:
AbstractMyMemoryTranslate
,ApertiumTranslate
,BelazarTranslate
,DeepLTranslate
,Google2Translate
,IBMWatsonTranslate
,YandexCloudTranslate
public abstract class BaseCachedTranslate extends BaseTranslate implements IMachineTranslation
Base class for machine translation.
-
-
Constructor Summary
Constructors Constructor Description BaseCachedTranslate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCachedTranslation(Language sLang, Language tLang, java.lang.String text)
Get cached translation.java.lang.String
getTranslation(Language sLang, Language tLang, java.lang.String text)
Translate.-
Methods inherited from class org.omegat.core.machinetranslators.BaseTranslate
isEnabled, setEnabled, setGlossarySupplier
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.omegat.gui.exttrans.IMachineTranslation
getName, isConfigurable, isEnabled, setEnabled, setGlossarySupplier, showConfigurationUI
-
-
-
-
Method Detail
-
getTranslation
public final java.lang.String getTranslation(Language sLang, Language tLang, java.lang.String text) throws java.lang.Exception
Translate.- Specified by:
getTranslation
in interfaceIMachineTranslation
- Overrides:
getTranslation
in classBaseTranslate
- Parameters:
sLang
- source languagetLang
- target languagetext
- text for translation- Returns:
- translated text, or null if translation impossible
- Throws:
java.lang.Exception
-
getCachedTranslation
public final java.lang.String getCachedTranslation(Language sLang, Language tLang, java.lang.String text)
Get cached translation. Returns null if translation not present.- Specified by:
getCachedTranslation
in interfaceIMachineTranslation
- Overrides:
getCachedTranslation
in classBaseTranslate
- Parameters:
sLang
- source languagetLang
- target languagetext
- text for translation- Returns:
- translated text, or null if translation impossible
-
-