Class DefaultTranslator
java.lang.Object
org.apache.tika.language.translate.DefaultTranslator
- All Implemented Interfaces:
Translator
Deprecated.
This version of the Apache Tika library is deprecated. Use your own version of Apache Tika.
A translator which picks the first available
Translator
implementations available through the
service provider mechanism.- Since:
- Apache Tika 1.6
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Returns the current translatorDeprecated.Returns all available translatorsbooleanDeprecated.Deprecated.Translate, using the first available service-loaded translatorDeprecated.Translate, using the first available service-loaded translator
-
Constructor Details
-
DefaultTranslator
Deprecated. -
DefaultTranslator
public DefaultTranslator()Deprecated.
-
-
Method Details
-
translate
public String translate(String text, String sourceLanguage, String targetLanguage) throws TikaException, IOException Deprecated.Translate, using the first available service-loaded translator- Specified by:
translatein interfaceTranslator- Parameters:
text- The text to translate.sourceLanguage- The input text language (for example, "en").targetLanguage- The desired language to translate to (for example, "fr").- Returns:
- The translation result. If translation is unavailable, returns the same text back.
- Throws:
TikaException- When there is an error translating.IOException
-
translate
Deprecated.Translate, using the first available service-loaded translator- Specified by:
translatein interfaceTranslator- Parameters:
text- The text to translate.targetLanguage- The desired language to translate to (for example, "hi").- Returns:
- The translation result. If translation is unavailable, returns the same text back.
- Throws:
TikaException- When there is an error translating.IOException
-
getTranslators
Deprecated.Returns all available translators -
getTranslator
Deprecated.Returns the current translator -
isAvailable
public boolean isAvailable()Deprecated.- Specified by:
isAvailablein interfaceTranslator- Returns:
- true if this Translator is probably able to translate right now.
-