Class LanguageWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable

    public class LanguageWriter
    extends java.io.Writer
    Writer that builds a language profile based on all the written content.
    Since:
    Apache Tika 0.10
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Ignored.
      void flush()
      Ignored.
      LanguageDetector getDetector()
      Returns the language detector used by this writer.
      LanguageResult getLanguage()
      Returns the detected language based on text written thus far.
      void reset()  
      void write​(char[] cbuf, int off, int len)  
      • Methods inherited from class java.io.Writer

        append, append, append, nullWriter, write, write, write, write
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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 java.io.Writer
      • close

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

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

        public void reset()