public class Language extends Object
Modifier and Type | Field and Description |
---|---|
protected FrequencyAnalyzer |
frequency |
protected String |
id |
protected TermStemmerIF |
stemmer |
protected StopList |
stoplist |
Constructor and Description |
---|
Language(String id,
TermStemmerIF stemmer,
StopList stoplist,
FrequencyAnalyzer frequency)
INTERNAL: Used to add additional languages by passing in all
parameters explicitly.
|
Modifier and Type | Method and Description |
---|---|
static Language |
detectLanguage(Document doc)
INTERNAL: Detects the language of the document based on the
built-in languages and new languages registered.
|
TermAnalyzerIF |
getFrequencyAnalyzer() |
static Language |
getLanguage(String lang) |
int |
getScore(Document doc) |
TermStemmerIF |
getStemmer() |
TermAnalyzerIF |
getStopListAnalyzer() |
static void |
registerLanguage(Language lang)
INTERNAL: Registers a new language for use by detectLanguage.
|
String |
toString() |
protected String id
protected TermStemmerIF stemmer
protected StopList stoplist
protected FrequencyAnalyzer frequency
public Language(String id, TermStemmerIF stemmer, StopList stoplist, FrequencyAnalyzer frequency)
public TermStemmerIF getStemmer()
public TermAnalyzerIF getStopListAnalyzer()
public TermAnalyzerIF getFrequencyAnalyzer()
public int getScore(Document doc)
public static void registerLanguage(Language lang)