Package org.apache.tika.langdetect.mitll
Class TextLangDetector
java.lang.Object
org.apache.tika.language.detect.LanguageDetector
org.apache.tika.langdetect.mitll.TextLangDetector
public class TextLangDetector
extends org.apache.tika.language.detect.LanguageDetector
Language Detection using MIT Lincoln Lab’s Text.jl library
https://github.com/trevorlewis/TextREST.jl
Please run the TextREST.jl server before using this.
-
Field Summary
Fields inherited from class org.apache.tika.language.detect.LanguageDetector
mixedLanguages, shortText -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddText(char[] cbuf, int off, int len) protected static booleancanRun()List<org.apache.tika.language.detect.LanguageResult>booleanorg.apache.tika.language.detect.LanguageDetectororg.apache.tika.language.detect.LanguageDetectorloadModels(Set<String> set) voidreset()org.apache.tika.language.detect.LanguageDetectorMethods inherited from class org.apache.tika.language.detect.LanguageDetector
addText, detect, detect, detectAll, getDefaultLanguageDetector, getLanguageDetectors, getLanguageDetectors, hasEnoughText, isMixedLanguages, isShortText, setMixedLanguages, setShortText
-
Constructor Details
-
TextLangDetector
public TextLangDetector()
-
-
Method Details
-
canRun
protected static boolean canRun() -
loadModels
- Specified by:
loadModelsin classorg.apache.tika.language.detect.LanguageDetector- Throws:
IOException
-
loadModels
public org.apache.tika.language.detect.LanguageDetector loadModels(Set<String> set) throws IOException - Specified by:
loadModelsin classorg.apache.tika.language.detect.LanguageDetector- Throws:
IOException
-
hasModel
- Specified by:
hasModelin classorg.apache.tika.language.detect.LanguageDetector
-
setPriors
public org.apache.tika.language.detect.LanguageDetector setPriors(Map<String, Float> languageProbabilities) throws IOException- Specified by:
setPriorsin classorg.apache.tika.language.detect.LanguageDetector- Throws:
IOException
-
reset
public void reset()- Specified by:
resetin classorg.apache.tika.language.detect.LanguageDetector
-
addText
public void addText(char[] cbuf, int off, int len) - Specified by:
addTextin classorg.apache.tika.language.detect.LanguageDetector
-
detectAll
- Specified by:
detectAllin classorg.apache.tika.language.detect.LanguageDetector
-