Package opennlp.tools.langdetect
Class LanguageDetectorConfig
- java.lang.Object
-
- opennlp.tools.langdetect.LanguageDetectorConfig
-
public class LanguageDetectorConfig extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_CHUNK_SIZEstatic LanguageDetectorConfigDEFAULT_LANGUAGE_DETECTOR_CONFIGstatic intDEFAULT_MAX_LENGTHstatic intDEFAULT_MIN_CONSEC_IMPROVEMENTSstatic doubleDEFAULT_MIN_DIFF
-
Constructor Summary
Constructors Constructor Description LanguageDetectorConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetChunkSize()Size in codepoints of chunk to process at each step for the probing detection.intgetMaxLength()Maximum length in codepoints of text to process.intgetMinConsecImprovements()Minimum number of consecutive increased probabilities for the top language required in probing detection to stop early.doublegetMinDiff()Minimum difference in confidence between the top predicted language and the next most likely language.voidsetChunkSize(int chunkSize)voidsetMaxLength(int maxLength)voidsetMinConsecImprovements(int minConsecImprovements)voidsetMinDiff(double minDiff)
-
-
-
Field Detail
-
DEFAULT_MAX_LENGTH
public static final int DEFAULT_MAX_LENGTH
- See Also:
- Constant Field Values
-
DEFAULT_CHUNK_SIZE
public static final int DEFAULT_CHUNK_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_MIN_CONSEC_IMPROVEMENTS
public static final int DEFAULT_MIN_CONSEC_IMPROVEMENTS
- See Also:
- Constant Field Values
-
DEFAULT_MIN_DIFF
public static final double DEFAULT_MIN_DIFF
- See Also:
- Constant Field Values
-
DEFAULT_LANGUAGE_DETECTOR_CONFIG
public static final LanguageDetectorConfig DEFAULT_LANGUAGE_DETECTOR_CONFIG
-
-
Method Detail
-
getMaxLength
public int getMaxLength()
Maximum length in codepoints of text to process.- Returns:
-
setMaxLength
public void setMaxLength(int maxLength)
-
getChunkSize
public int getChunkSize()
Size in codepoints of chunk to process at each step for the probing detection.After processing a chunk of this size, the probing detection will compute probabilities and determine if there is enough confidence to stop.
- Returns:
-
setChunkSize
public void setChunkSize(int chunkSize)
-
getMinConsecImprovements
public int getMinConsecImprovements()
Minimum number of consecutive increased probabilities for the top language required in probing detection to stop early.If this value equals 0, probing detection will rely solely on
getMinDiff()- Returns:
- minimum consecutive improvements
-
setMinConsecImprovements
public void setMinConsecImprovements(int minConsecImprovements)
-
getMinDiff
public double getMinDiff()
Minimum difference in confidence between the top predicted language and the next most likely language.If this value equals 0, probing detection will rely solely on
getMinConsecImprovements()- Returns:
-
setMinDiff
public void setMinDiff(double minDiff)
-
-