org.egothor.stemmer
Class Stock

java.lang.Object
  extended by org.egothor.stemmer.Stock

public class Stock
extends java.lang.Object

The Stock object is a collector of some stemmers. The stemmers are added via initialize(java.util.Locale, java.lang.String) method. The very first stemmer that is added is denoted as default. An access to stemmers is possible via getStemmer method.

Author:
Leo Galambos

Constructor Summary
Stock()
          Constructor for the Stock object.
 
Method Summary
 Trie getStemmer(java.util.Locale lang)
          Return the Trie (stemmer) for the given language.
 boolean initialize(java.util.Locale lang, java.lang.String location)
          Upload a new stemmer table into this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stock

public Stock()
Constructor for the Stock object. It constructs the default stemmer that is loaded from a file that is specified by the system default.stem property.

Method Detail

initialize

public boolean initialize(java.util.Locale lang,
                          java.lang.String location)
Upload a new stemmer table into this object. If the location parameter is null, the location file path is read from egothor.stemmer.default system variable.

Returns:
false if the initialization was not successful

getStemmer

public Trie getStemmer(java.util.Locale lang)
Return the Trie (stemmer) for the given language. Ig the lang parameter is null, the default stemmer is returned.

Parameters:
lang - the language for which a stemmer should be returned
Returns:
a Trie (stemmer)