net.ontopia.topicmaps.classify
Class Language

java.lang.Object
  extended by 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.


Field Summary
protected  FrequencyAnalyzer frequency
           
protected  java.lang.String id
           
protected  TermStemmerIF stemmer
           
protected  StopList stoplist
           
 
Constructor Summary
Language(java.lang.String id, TermStemmerIF stemmer, StopList stoplist, FrequencyAnalyzer frequency)
          INTERNAL: Used to add additional languages by passing in all parameters explicitly.
 
Method Summary
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(java.lang.String lang)
           
 int getScore(Document doc)
           
 TermStemmerIF getStemmer()
           
 TermAnalyzerIF getStopListAnalyzer()
           
static void registerLanguage(Language lang)
          INTERNAL: Registers a new language for use by detectLanguage.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected java.lang.String id

stemmer

protected TermStemmerIF stemmer

stoplist

protected StopList stoplist

frequency

protected FrequencyAnalyzer frequency
Constructor Detail

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.

Method Detail

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.