Package org.omegat.gui.exttrans
Interface IMachineTranslation
- All Known Implementing Classes:
BaseCachedTranslate,BaseTranslate
public interface IMachineTranslation
Interface for all machine translation systems.
-
Method Summary
Modifier and TypeMethodDescription@Nullable StringgetCachedTranslation(Language sLang, Language tLang, String text) Get cached translation.getName()Get machine translation engine name.@Nullable StringgetTranslation(Language sLang, Language tLang, String text) Translate.default booleanIndicates that the MT provider has options that can be configured.booleanDetermine whether the MT provider has been enabled by the user.default voidsetEnabled(boolean enabled) Turn the MT provider on or offdefault voidsetGlossarySupplier(IMTGlossarySupplier glossarySupplier) Set a glossary supplier to provide relevant glossary terms if desired.default voidshowConfigurationUI(Window parent) Invoke the configuration UI of this MT provider.
-
Method Details
-
getName
String getName()Get machine translation engine name. -
isEnabled
boolean isEnabled()Determine whether the MT provider has been enabled by the user. -
setEnabled
default void setEnabled(boolean enabled) Turn the MT provider on or off -
setGlossarySupplier
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- the glossary supplier
-
getTranslation
Translate.- Parameters:
sLang- source languagetLang- target languagetext- text for translation- Returns:
- translated text, or null if translation impossible
- Throws:
Exception
-
getCachedTranslation
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
Invoke the configuration UI of this MT provider.
-