public class SnowballStemmer extends java.lang.Object implements Stemmer, OptionHandler
-S <name> The name of the snowball stemmer (default 'porter'). available stemmers: danish, dutch, english, finnish, french, german, italian, norwegian, porter, portuguese, russian, spanish, swedish
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PACKAGE
the package name for snowball.
|
static java.lang.String |
PACKAGE_EXT
the package name where the stemmers are located.
|
Constructor and Description |
---|
SnowballStemmer()
initializes the stemmer ("porter").
|
SnowballStemmer(java.lang.String name)
initializes the stemmer with the given stemmer.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getOptions()
Gets the current settings of the classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
java.lang.String |
getStemmer()
returns the name of the current stemmer, null if none is set.
|
java.lang.String |
globalInfo()
Returns a string describing the stemmer.
|
static boolean |
isPresent()
returns whether Snowball is present or not, i.e.
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static java.util.Enumeration<java.lang.String> |
listStemmers()
returns an enumeration over all currently stored stemmer names.
|
static void |
main(java.lang.String[] args)
Runs the stemmer with the given options.
|
void |
setOptions(java.lang.String[] options)
Parses the options.
|
void |
setStemmer(java.lang.String name)
sets the stemmer with the given name, e.g., "porter".
|
java.lang.String |
stem(java.lang.String word)
Returns the word in its stemmed form.
|
java.lang.String |
stemmerTipText()
Returns the tip text for this property.
|
java.lang.String |
toString()
returns a string representation of the stemmer.
|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public static final java.lang.String PACKAGE
public static final java.lang.String PACKAGE_EXT
public SnowballStemmer()
public SnowballStemmer(java.lang.String name)
name
- the name of the stemmerpublic java.lang.String globalInfo()
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-S <name> The name of the snowball stemmer (default 'porter'). available stemmers: danish, dutch, english, finnish, french, german, italian, norwegian, porter, portuguese, russian, spanish, swedish
setOptions
in interface OptionHandler
options
- the options to parsejava.lang.Exception
- if parsing failspublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public static boolean isPresent()
public static java.util.Enumeration<java.lang.String> listStemmers()
public java.lang.String getStemmer()
public void setStemmer(java.lang.String name)
name
- the name of the stemmer, e.g., "porter"public java.lang.String stemmerTipText()
public java.lang.String stem(java.lang.String word)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
public static void main(java.lang.String[] args)
args
- the options