Class EmptyTranslator
- java.lang.Object
- 
- org.apache.tika.language.translate.EmptyTranslator
 
- 
- All Implemented Interfaces:
- Translator
 
 public class EmptyTranslator extends Object implements Translator Dummy translator that always declines to give any text. Useful as a sentinel translator for when none others are available. for unknown document types.
- 
- 
Constructor SummaryConstructors Constructor Description EmptyTranslator()
 - 
Method SummaryAll Methods Instance Methods Concrete 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- 
translatepublic String translate(String text, String sourceLanguage, String targetLanguage) Description copied from interface:TranslatorTranslate text between given languages.- Specified by:
- translatein interface- Translator
- 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.
 
 - 
translatepublic String translate(String text, String targetLanguage) Description copied from interface:TranslatorTranslate text to the given language This method attempts to auto-detect the source language of the text.- Specified by:
- translatein interface- Translator
- 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.
 
 - 
isAvailablepublic boolean isAvailable() - Specified by:
- isAvailablein interface- Translator
- Returns:
- true if this Translator is probably able to translate right now.
 
 
- 
 
-