Interface IMachineTranslation

    • 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 language
        tLang - target language
        text - 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 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​(java.awt.Window parent)
        Invoke the configuration UI of this MT provider.