public class DetectorFactory
extends java.lang.Object
Detector
.
Before using language detection library,
load profiles with
loadProfiles(List profiles)
method
and set initialization parameters.
When the language detection,
construct Detector instance via create()
.
See also Detector
's sample code.
Detector
Modifier and Type | Field and Description |
---|---|
java.util.ArrayList<java.lang.String> |
langlist |
java.lang.Long |
seed |
java.util.HashMap<java.lang.String,double[]> |
wordLangProbMap |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
addProfile(LangProfile profile,
int index,
int langsize) |
static void |
clear()
Clear loaded language profiles (reinitialization to be available)
|
static Detector |
create()
Construct Detector instance
|
static Detector |
create(double alpha)
Construct Detector instance with smoothing parameter
|
static java.util.List<java.lang.String> |
getLangList() |
protected static CLangProfile |
getLanguageProfile(java.lang.String profileName)
Instantiate a language profile class.
|
static void |
loadProfiles(java.util.List<LangProfile> profiles) |
static void |
loadProfilesByName(java.util.List<java.lang.String> profileNames)
Load language profiles by name.
|
static void |
setSeed(long seed) |
public java.util.HashMap<java.lang.String,double[]> wordLangProbMap
public java.util.ArrayList<java.lang.String> langlist
public java.lang.Long seed
public static void loadProfiles(java.util.List<LangProfile> profiles)
public static void loadProfilesByName(java.util.List<java.lang.String> profileNames)
profileNames
- String list of profile names.
The list of loaded language profiles is set to those specified in the profile names list.
static void addProfile(LangProfile profile, int index, int langsize)
profile
- langsize
- index
- LangDetectException
public static void clear()
public static Detector create()
LangDetectException
public static Detector create(double alpha) throws LangDetectException
alpha
- smoothing parameter (default value = 0.5)LangDetectException
public static void setSeed(long seed)
public static final java.util.List<java.lang.String> getLangList()
protected static CLangProfile getLanguageProfile(java.lang.String profileName)
profileName
- Language profile name.