Class BaseTranslate

    • Constructor Detail

      • BaseTranslate

        public BaseTranslate()
    • Method Detail

      • isEnabled

        public boolean isEnabled()
        Determine whether or not the MT provider has been enabled by the user.
        Specified by:
        isEnabled in interface IMachineTranslation
      • setEnabled

        public void setEnabled​(boolean enabled)
        Turn the MT provider on or off
        Specified by:
        setEnabled in interface IMachineTranslation
      • setGlossarySupplier

        public 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.
        Specified by:
        setGlossarySupplier in interface IMachineTranslation
      • getTranslation

        public java.lang.String getTranslation​(Language sLang,
                                               Language tLang,
                                               java.lang.String text)
                                        throws java.lang.Exception
        Translate.
        Specified by:
        getTranslation in interface IMachineTranslation
        Parameters:
        sLang - source language
        tLang - target language
        text - text for translation
        Returns:
        translated text, or null if translation impossible
        Throws:
        java.lang.Exception
      • getCachedTranslation

        public java.lang.String getCachedTranslation​(Language sLang,
                                                     Language tLang,
                                                     java.lang.String text)
        Get cached translation. Returns null if translation not present.
        Specified by:
        getCachedTranslation in interface IMachineTranslation
        Parameters:
        sLang - source language
        tLang - target language
        text - text for translation
        Returns:
        translated text, or null if translation impossible