public class SnowballStemmer extends 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 String |
PACKAGE
the package name for snowball.
|
static String |
PACKAGE_EXT
the package name where the stemmers are located.
|
Constructor and Description |
---|
SnowballStemmer()
initializes the stemmer ("porter").
|
SnowballStemmer(String name)
initializes the stemmer with the given stemmer.
|
Modifier and Type | Method and Description |
---|---|
String[] |
getOptions()
Gets the current settings of the classifier.
|
String |
getRevision()
Returns the revision string.
|
String |
getStemmer()
returns the name of the current stemmer, null if none is set.
|
String |
globalInfo()
Returns a string describing the stemmer.
|
static boolean |
isPresent()
returns whether Snowball is present or not, i.e.
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static Enumeration |
listStemmers()
returns an enumeration over all currently stored stemmer names.
|
static void |
main(String[] args)
Runs the stemmer with the given options.
|
void |
setOptions(String[] options)
Parses the options.
|
void |
setStemmer(String name)
sets the stemmer with the given name, e.g., "porter".
|
String |
stem(String word)
Returns the word in its stemmed form.
|
String |
stemmerTipText()
Returns the tip text for this property.
|
String |
toString()
returns a string representation of the stemmer.
|
public static final String PACKAGE
public static final String PACKAGE_EXT
public SnowballStemmer()
public SnowballStemmer(String name)
name
- the name of the stemmerpublic String globalInfo()
public Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(String[] options) throws 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 parseException
- if parsing failspublic String[] getOptions()
getOptions
in interface OptionHandler
public static boolean isPresent()
public static Enumeration listStemmers()
public String getStemmer()
public void setStemmer(String name)
name
- the name of the stemmer, e.g., "porter"public String stemmerTipText()
public String toString()
public String getRevision()
getRevision
in interface RevisionHandler
public static void main(String[] args)
args
- the optionsCopyright © 2016 University of Waikato, Hamilton, NZ. All Rights Reserved.