Interface Translator
- 
- All Known Implementing Classes:
- AbstractTranslator,- CachedTranslator,- DefaultTranslator,- EmptyTranslator,- ExternalTranslator,- GoogleTranslator,- JoshuaNetworkTranslator,- Lingo24Translator,- MarianTranslator,- MicrosoftTranslator,- MosesTranslator,- RTGTranslator,- YandexTranslator
 
 public interface TranslatorInterface for Translator services.- Since:
- Tika 1.6
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisAvailable()Stringtranslate(String text, String targetLanguage)Translate text to the given language This method attempts to auto-detect the source language of the text.Stringtranslate(String text, String sourceLanguage, String targetLanguage)Translate text between given languages.
 
- 
- 
- 
Method Detail- 
translateString translate(String text, String sourceLanguage, String targetLanguage) throws TikaException, IOException Translate text between given languages.- 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
- Since:
- Tika 1.6
 
 - 
translateString translate(String text, String targetLanguage) throws TikaException, IOException Translate text to the given language This method attempts to auto-detect the source language of the text.- 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
- Since:
- Tika 1.6
 
 - 
isAvailableboolean isAvailable() - Returns:
- true if this Translator is probably able to translate right now.
- Since:
- Tika 1.6
 
 
- 
 
-