Package org.omegat.gui.exttrans
Interface IMachineTranslation
-
- All Known Implementing Classes:
AbstractMyMemoryTranslate
,ApertiumTranslate
,BaseCachedTranslate
,BaseTranslate
,BelazarTranslate
,DeepLTranslate
,Google2Translate
,IBMWatsonTranslate
,MyMemoryHumanTranslate
,MyMemoryMachineTranslate
,YandexCloudTranslate
public interface IMachineTranslation
Interface for all machine translation systems.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.String
getCachedTranslation(Language sLang, Language tLang, java.lang.String text)
Get cached translation.java.lang.String
getName()
Get machine translation engine name.java.lang.String
getTranslation(Language sLang, Language tLang, java.lang.String text)
Translate.default boolean
isConfigurable()
Indicates that the MT provider has options that can be configured.boolean
isEnabled()
Determine whether or not the MT provider has been enabled by the user.default void
setEnabled(boolean enabled)
Turn the MT provider on or offdefault void
setGlossarySupplier(IMTGlossarySupplier glossarySupplier)
Set a glossary supplier to provide relevant glossary terms if desired.default void
showConfigurationUI(java.awt.Window parent)
Invoke the configuration UI of this MT provider.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Get machine translation engine name.
-
isEnabled
boolean isEnabled()
Determine whether or not the MT provider has been enabled by the user.
-
setEnabled
default void setEnabled(boolean enabled)
Turn the MT provider on or off
-
setGlossarySupplier
default void setGlossarySupplier(IMTGlossarySupplier glossarySupplier)
Set 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.- Parameters:
glossarySupplier
-
-
getTranslation
java.lang.String getTranslation(Language sLang, Language tLang, java.lang.String text) throws java.lang.Exception
Translate.- Parameters:
sLang
- source languagetLang
- target languagetext
- text for translation- Returns:
- translated text, or null if translation impossible
- Throws:
java.lang.Exception
-
getCachedTranslation
java.lang.String getCachedTranslation(Language sLang, Language tLang, java.lang.String text)
Get cached translation. Returns null if translation not present.- Parameters:
sLang
- source languagetLang
- target languagetext
- text for translation- Returns:
- translated text, or null if translation impossible
-
isConfigurable
default boolean isConfigurable()
Indicates that the MT provider has options that can be configured. Configurable implementations should override this to returntrue
, and implement their configuration UI by overridingshowConfigurationUI(Window)
.
-
showConfigurationUI
default void showConfigurationUI(java.awt.Window parent)
Invoke the configuration UI of this MT provider.
-
-