Package org.apache.tika.langdetect.tika
Class ProfilingWriter
- java.lang.Object
-
- java.io.Writer
-
- org.apache.tika.langdetect.tika.ProfilingWriter
-
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
public class ProfilingWriter extends Writer
Writer that builds a language profile based on all the written content.- Since:
- Apache Tika 0.5
-
-
Constructor Summary
Constructors Constructor Description ProfilingWriter()
ProfilingWriter(LanguageProfile profile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
Ignored.LanguageIdentifier
getLanguage()
Returns the language that best matches the current state of the language profile.LanguageProfile
getProfile()
Returns the language profile being built by this writer.void
write(char[] cbuf, int off, int len)
-
-
-
Constructor Detail
-
ProfilingWriter
public ProfilingWriter(LanguageProfile profile)
-
ProfilingWriter
public ProfilingWriter()
-
-
Method Detail
-
getProfile
public LanguageProfile getProfile()
Returns the language profile being built by this writer. Note that the returned profile gets updated whenever new characters are written. Use thegetLanguage()
method to get the language that best matches the current state of the profile.- Returns:
- language profile
-
getLanguage
public LanguageIdentifier getLanguage()
Returns the language that best matches the current state of the language profile.- Returns:
- language that best matches the current profile
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classWriter
- Throws:
IOException
-
-