Class BaseTranslate
java.lang.Object
org.omegat.core.machinetranslators.BaseTranslate
- All Implemented Interfaces:
IMachineTranslation
- Direct Known Subclasses:
BaseCachedTranslate
Base class for machine translation.
-
Method Summary
Modifier and TypeMethodDescriptiongetCachedTranslation(Language sLang, Language tLang, String text) Get cached translation.getTranslation(Language sLang, Language tLang, String text) Translate.booleanDetermine whether the MT provider has been enabled by the user.voidsetEnabled(boolean enabled) Turn the MT provider on or offvoidsetGlossarySupplier(IMTGlossarySupplier glossarySupplier) Set a glossary supplier to provide relevant glossary terms if desired.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.omegat.gui.exttrans.IMachineTranslation
getName, isConfigurable, showConfigurationUI
-
Method Details
-
isEnabled
public boolean isEnabled()Description copied from interface:IMachineTranslationDetermine whether the MT provider has been enabled by the user.- Specified by:
isEnabledin interfaceIMachineTranslation
-
setEnabled
public void setEnabled(boolean enabled) Description copied from interface:IMachineTranslationTurn the MT provider on or off- Specified by:
setEnabledin interfaceIMachineTranslation
-
setGlossarySupplier
Description copied from interface:IMachineTranslationSet a glossary supplier to provide relevant glossary terms if desired. The terms are provided as a map with keys being the source terms and values being the target terms.- Specified by:
setGlossarySupplierin interfaceIMachineTranslation- Parameters:
glossarySupplier- the glossary supplier
-
getTranslation
Description copied from interface:IMachineTranslationTranslate.- Specified by:
getTranslationin interfaceIMachineTranslation- Parameters:
sLang- source languagetLang- target languagetext- text for translation- Returns:
- translated text, or null if translation impossible
- Throws:
Exception
-
getCachedTranslation
Description copied from interface:IMachineTranslationGet cached translation. Returns null if translation not present.- Specified by:
getCachedTranslationin interfaceIMachineTranslation- Parameters:
sLang- source languagetLang- target languagetext- text for translation- Returns:
- translated text, or null if translation impossible
-