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 |
---|---|
protected Method |
m_GetCurrentMethod
the getCurrent method.
|
protected static boolean |
m_Present
whether the snowball stemmers are in the Classpath.
|
protected Method |
m_SetCurrentMethod
the setCurrent method.
|
protected Object |
m_Stemmer
the current stemmer.
|
protected static Vector |
m_Stemmers
contains the all the found stemmers (language names).
|
protected Method |
m_StemMethod
the stem method.
|
static String |
PACKAGE
the package name for snowball.
|
static String |
PACKAGE_EXT
the package name where the stemmers are located.
|
protected static String |
SNOWBALL_PROGRAM
the snowball program, all stemmers are derived from.
|
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
protected static final String SNOWBALL_PROGRAM
protected static boolean m_Present
protected static Vector m_Stemmers
protected Object m_Stemmer
protected transient Method m_StemMethod
protected transient Method m_SetCurrentMethod
protected transient Method m_GetCurrentMethod
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 © 2015 University of Waikato, Hamilton, NZ. All rights reserved.