|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.stemmers.SnowballStemmer
public class SnowballStemmer
A wrapper class for the Snowball stemmers. Only available if the Snowball classes are in the classpath.
If the class discovery is not dynamic, i.e., the property 'UseDynamic' in the props file 'weka/gui/GenericPropertiesCreator.props' is 'false', then the property 'org.tartarus.snowball.SnowballProgram' in the 'weka/gui/GenericObjectEditor.props' file has to be uncommented as well. If necessary you have to discover and fill in the snowball stemmers manually. You can use the 'weka.core.ClassDiscovery' for this:
java weka.core.ClassDiscovery org.tartarus.snowball.SnowballProgram org.tartarus.snowball.ext
For more information visit these web sites:
http://weka.wikispaces.com/Stemmers
http://snowball.tartarus.org/
-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
Field Summary | |
---|---|
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 Summary | |
---|---|
SnowballStemmer()
initializes the stemmer ("porter"). |
|
SnowballStemmer(java.lang.String name)
initializes the stemmer with the given stemmer. |
Method Summary | |
---|---|
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 |
listOptions()
Returns an enumeration describing the available options. |
static java.util.Enumeration |
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PACKAGE
public static final java.lang.String PACKAGE_EXT
Constructor Detail |
---|
public SnowballStemmer()
public SnowballStemmer(java.lang.String name)
name
- the name of the stemmerMethod Detail |
---|
public java.lang.String globalInfo()
public java.util.Enumeration 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 parse
java.lang.Exception
- if parsing failspublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public static boolean isPresent()
public static java.util.Enumeration 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)
stem
in interface Stemmer
word
- the unstemmed 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |