public class LanguageDetectorConfig extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CHUNK_SIZE |
static LanguageDetectorConfig |
DEFAULT_LANGUAGE_DETECTOR_CONFIG |
static int |
DEFAULT_MAX_LENGTH |
static int |
DEFAULT_MIN_CONSEC_IMPROVEMENTS |
static double |
DEFAULT_MIN_DIFF |
Constructor and Description |
---|
LanguageDetectorConfig() |
Modifier and Type | Method and Description |
---|---|
int |
getChunkSize()
Size in codepoints of chunk to process at each
step for the probing detection.
|
int |
getMaxLength()
Maximum length in codepoints of text to process.
|
int |
getMinConsecImprovements()
Minimum number of consecutive increased probabilities
for the top language required in probing detection
to stop early.
|
double |
getMinDiff()
Minimum difference in confidence between the top predicted
language and the next most likely language.
|
void |
setChunkSize(int chunkSize) |
void |
setMaxLength(int maxLength) |
void |
setMinConsecImprovements(int minConsecImprovements) |
void |
setMinDiff(double minDiff) |
public static final int DEFAULT_MAX_LENGTH
public static final int DEFAULT_CHUNK_SIZE
public static final int DEFAULT_MIN_CONSEC_IMPROVEMENTS
public static final double DEFAULT_MIN_DIFF
public static final LanguageDetectorConfig DEFAULT_LANGUAGE_DETECTOR_CONFIG
public int getMaxLength()
public void setMaxLength(int maxLength)
public int getChunkSize()
After processing a chunk of this size, the probing detection will compute probabilities and determine if there is enough confidence to stop.
public void setChunkSize(int chunkSize)
public int getMinConsecImprovements()
If this value equals 0, probing detection will
rely solely on getMinDiff()
public void setMinConsecImprovements(int minConsecImprovements)
public double getMinDiff()
If this value equals 0, probing detection will
rely solely on getMinConsecImprovements()
public void setMinDiff(double minDiff)
Copyright © 2021 The Apache Software Foundation. All rights reserved.