Interface IMachineTranslation

All Known Implementing Classes:
BaseCachedTranslate, BaseTranslate

public interface IMachineTranslation
Interface for all machine translation systems.
  • 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

      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 - the glossary supplier
    • getTranslation

      @Nullable String getTranslation(Language sLang, Language tLang, String text) throws Exception
      Translate.
      Parameters:
      sLang - source language
      tLang - target language
      text - text for translation
      Returns:
      translated text, or null if translation impossible
      Throws:
      Exception
    • getCachedTranslation

      @Nullable String getCachedTranslation(Language sLang, Language tLang, String text)
      Get cached translation. Returns null if translation not present.
      Parameters:
      sLang - source language
      tLang - target language
      text - 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 return true, and implement their configuration UI by overriding showConfigurationUI(Window).
    • showConfigurationUI

      default void showConfigurationUI(Window parent)
      Invoke the configuration UI of this MT provider.