Class LanguageWriter

java.lang.Object
java.io.Writer
org.apache.tika.language.detect.LanguageWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class LanguageWriter extends Writer
Writer that builds a language profile based on all the written content.
Since:
Apache Tika 0.10
  • Constructor Details

  • Method Details

    • getDetector

      public LanguageDetector getDetector()
      Returns the language detector used by this writer. Note that the returned language detector gets updated whenever new characters are written.
      Returns:
      language detector
    • getLanguage

      public LanguageResult getLanguage()
      Returns the detected language based on text written thus far.
      Returns:
      LanguageResult
    • write

      public void write(char[] cbuf, int off, int len)
      Specified by:
      write in class Writer
    • close

      public void close() throws IOException
      Ignored.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class Writer
      Throws:
      IOException
    • flush

      public void flush()
      Ignored.
      Specified by:
      flush in interface Flushable
      Specified by:
      flush in class Writer
    • reset

      public void reset()