Package opennlp.tools.langdetect
Class LanguageDetectorConfig
java.lang.Object
opennlp.tools.langdetect.LanguageDetectorConfig
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final LanguageDetectorConfig
static final int
static final int
static final double
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
After processing a chunk of this size, the probing detection will compute probabilities and determine if there is enough confidence to stop.int
int
If this value equals0
, probing detection will rely solely ongetMinDiff()
double
If this value equals0
, probing detection will rely solely ongetMinConsecImprovements()
void
setChunkSize
(int chunkSize) void
setMaxLength
(int maxLength) void
setMinConsecImprovements
(int minConsecImprovements) void
setMinDiff
(double minDiff)
-
Field Details
-
DEFAULT_MAX_LENGTH
public static final int DEFAULT_MAX_LENGTH- See Also:
-
DEFAULT_CHUNK_SIZE
public static final int DEFAULT_CHUNK_SIZE- See Also:
-
DEFAULT_MIN_CONSEC_IMPROVEMENTS
public static final int DEFAULT_MIN_CONSEC_IMPROVEMENTS- See Also:
-
DEFAULT_MIN_DIFF
public static final double DEFAULT_MIN_DIFF- See Also:
-
DEFAULT_LANGUAGE_DETECTOR_CONFIG
-
-
Constructor Details
-
LanguageDetectorConfig
public LanguageDetectorConfig()
-
-
Method Details
-
getMaxLength
public int getMaxLength()- Returns:
- The maximum length in codepoints of text to process.
-
setMaxLength
public void setMaxLength(int maxLength) -
getChunkSize
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.- Returns:
- The size in codepoints of chunk to process at each step for the probing detection.
-
setChunkSize
public void setChunkSize(int chunkSize) -
getMinConsecImprovements
public int getMinConsecImprovements()If this value equals0
, probing detection will rely solely ongetMinDiff()
- Returns:
- The minimum number of consecutive increased probabilities for the top language required in probing detection to stop early.
-
setMinConsecImprovements
public void setMinConsecImprovements(int minConsecImprovements) -
getMinDiff
public double getMinDiff()If this value equals0
, probing detection will rely solely ongetMinConsecImprovements()
- Returns:
- The minimum difference in confidence between the top predicted language and the next most likely language.
-
setMinDiff
public void setMinDiff(double minDiff)
-