Class EmptyTranslator

java.lang.Object
org.apache.tika.language.translate.EmptyTranslator
All Implemented Interfaces:
Translator

@Deprecated(since="2026-04-30") public class EmptyTranslator extends Object implements Translator
Deprecated.
This version of the Apache Tika library is deprecated. Use your own version of Apache Tika.
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 Details

    • EmptyTranslator

      public EmptyTranslator()
      Deprecated.
  • Method Details

    • translate

      public String translate(String text, String sourceLanguage, String targetLanguage)
      Deprecated.
      Description copied from interface: Translator
      Translate text between given languages.
      Specified by:
      translate in 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.
    • translate

      public String translate(String text, String targetLanguage)
      Deprecated.
      Description copied from interface: Translator
      Translate text to the given language This method attempts to auto-detect the source language of the text.
      Specified by:
      translate in 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.
    • isAvailable

      public boolean isAvailable()
      Deprecated.
      Specified by:
      isAvailable in interface Translator
      Returns:
      true if this Translator is probably able to translate right now.