|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cybozu.labs.langdetect.DetectorFactory
public class DetectorFactory
Language Detector Factory Class
This class manages an initialization and constructions of Detector.
Before using language detection library,
load profiles with loadProfile(String) method
and set initialization parameters.
When the language detection,
construct Detector instance via create().
See also Detector's sample code.
Detector| Field Summary | |
|---|---|
ArrayList<String> |
langlist
|
Long |
seed
|
HashMap<String,double[]> |
wordLangProbMap
|
| Method Summary | |
|---|---|
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 List<String> |
getLangList()
|
static void |
loadProfile(File profileDirectory)
Load profiles from specified directory. |
static void |
loadProfile(List<String> json_profiles)
Load profiles from specified directory. |
static void |
loadProfile(String profileDirectory)
Load profiles from specified directory. |
static void |
setSeed(long seed)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public HashMap<String,double[]> wordLangProbMap
public ArrayList<String> langlist
public Long seed
| Method Detail |
|---|
public static void loadProfile(String profileDirectory)
throws LangDetectException
profileDirectory - profile directory path
LangDetectException - Can't open profiles(error code = ErrorCode.FileLoadError)
or profile's format is wrong (error code = ErrorCode.FormatError)
public static void loadProfile(File profileDirectory)
throws LangDetectException
profileDirectory - profile directory path
LangDetectException - Can't open profiles(error code = ErrorCode.FileLoadError)
or profile's format is wrong (error code = ErrorCode.FormatError)
public static void loadProfile(List<String> json_profiles)
throws LangDetectException
LangDetectException - Can't open profiles(error code = ErrorCode.FileLoadError)
or profile's format is wrong (error code = ErrorCode.FormatError)public static void clear()
public static Detector create()
throws LangDetectException
LangDetectException
public static Detector create(double alpha)
throws LangDetectException
alpha - smoothing parameter (default value = 0.5)
LangDetectExceptionpublic static void setSeed(long seed)
public static final List<String> getLangList()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||