public class LanguageDetector extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LanguageDetector.WeightedLocale
A langauge with an associated confidence
|
| Modifier and Type | Field and Description |
|---|---|
static String |
LANGUAGE_MODEL_BINARY
default location of the compressed binary version of the language model
|
| Constructor and Description |
|---|
LanguageDetector()
Load a language model from "/org/openimaj/text/language/language.model.binary.gz"
|
| Modifier and Type | Method and Description |
|---|---|
LanguageDetector.WeightedLocale |
classify(String text)
Classify the language using a naive-bayes model
|
LanguageModel |
getLanguageModel() |
static void |
main(String[] args)
prints available languages
|
public static final String LANGUAGE_MODEL_BINARY
public LanguageDetector()
throws IOException
IOExceptionpublic LanguageDetector.WeightedLocale classify(String text)
text - public LanguageModel getLanguageModel()
LanguageModelpublic static void main(String[] args) throws IOException
args - IOExceptionCopyright © 2017. All rights reserved.