public class OptimaizeLangDetector
extends org.apache.tika.language.detect.LanguageDetector
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_CHARS_FOR_DETECTION |
static int |
DEFAULT_MAX_CHARS_FOR_SHORT_DETECTION |
| Constructor and Description |
|---|
OptimaizeLangDetector() |
OptimaizeLangDetector(int maxCharsForDetection) |
| Modifier and Type | Method and Description |
|---|---|
void |
addText(char[] cbuf,
int off,
int len) |
List<org.apache.tika.language.detect.LanguageResult> |
detectAll() |
boolean |
hasEnoughText() |
boolean |
hasModel(String language) |
org.apache.tika.language.detect.LanguageDetector |
loadModels() |
org.apache.tika.language.detect.LanguageDetector |
loadModels(Set<String> languages) |
void |
reset() |
org.apache.tika.language.detect.LanguageDetector |
setPriors(Map<String,Float> languageProbabilities) |
public static final int DEFAULT_MAX_CHARS_FOR_DETECTION
public static final int DEFAULT_MAX_CHARS_FOR_SHORT_DETECTION
public OptimaizeLangDetector()
public OptimaizeLangDetector(int maxCharsForDetection)
public org.apache.tika.language.detect.LanguageDetector loadModels()
loadModels in class org.apache.tika.language.detect.LanguageDetectorpublic org.apache.tika.language.detect.LanguageDetector loadModels(Set<String> languages) throws IOException
loadModels in class org.apache.tika.language.detect.LanguageDetectorIOExceptionpublic boolean hasModel(String language)
hasModel in class org.apache.tika.language.detect.LanguageDetectorpublic org.apache.tika.language.detect.LanguageDetector setPriors(Map<String,Float> languageProbabilities) throws IOException
setPriors in class org.apache.tika.language.detect.LanguageDetectorIOExceptionpublic void reset()
reset in class org.apache.tika.language.detect.LanguageDetectorpublic void addText(char[] cbuf,
int off,
int len)
addText in class org.apache.tika.language.detect.LanguageDetectorpublic List<org.apache.tika.language.detect.LanguageResult> detectAll()
detectAll in class org.apache.tika.language.detect.LanguageDetectorIllegalStateException - if no models have been loaded with
loadModels() or loadModels(java.util.Set)public boolean hasEnoughText()
hasEnoughText in class org.apache.tika.language.detect.LanguageDetectorCopyright © 2007–2022 The Apache Software Foundation. All rights reserved.