net.ontopia.topicmaps.classify
Class Language
java.lang.Object
net.ontopia.topicmaps.classify.Language
public class Language
- extends java.lang.Object
INTERNAL: Object representing a particular language. The object is
really just a container for a stemmer, a stop list, and a frequency
analyzer.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
id
protected java.lang.String id
stemmer
protected TermStemmerIF stemmer
stoplist
protected StopList stoplist
frequency
protected FrequencyAnalyzer frequency
Language
public Language(java.lang.String id,
TermStemmerIF stemmer,
StopList stoplist,
FrequencyAnalyzer frequency)
- INTERNAL: Used to add additional languages by passing in all
parameters explicitly.
getStemmer
public TermStemmerIF getStemmer()
getStopListAnalyzer
public TermAnalyzerIF getStopListAnalyzer()
getFrequencyAnalyzer
public TermAnalyzerIF getFrequencyAnalyzer()
getScore
public int getScore(Document doc)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getLanguage
public static Language getLanguage(java.lang.String lang)
registerLanguage
public static void registerLanguage(Language lang)
- INTERNAL: Registers a new language for use by detectLanguage.
Warning: this method is not idempotent.
detectLanguage
public static Language detectLanguage(Document doc)
- INTERNAL: Detects the language of the document based on the
built-in languages and new languages registered.
Copyright © 2000-2012 Ontopia.