jsat.text.stemming
Class Stemmer
- java.lang.Object
-
- jsat.text.stemming.Stemmer
-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- LovinsStemmer, PaiceHuskStemmer, PorterStemmer, VoidStemmer
public abstract class Stemmer extends java.lang.Object implements java.io.SerializableStemmers are algorithms that attempt reduce strings to their common stem or root word. For example, a stemmer might idly reduce "runs" "running" and "ran" to the single stem word "run". This reduces the feature space size, and allows multiple words that have the same meaning to be counted together.
Do not expect perfect results from stemming. This class provides the contract for a stemmer that does not have any word history.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Stemmer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidapplyTo(java.util.List<java.lang.String> list)Replaces each value in the list with the stemmed version of the wordvoidapplyTo(java.lang.String[] arr)Replaces each value in the array with the stemmed version of the wordabstract java.lang.Stringstem(java.lang.String word)Reduce the given input to its stem word
-
-
-
Method Detail
-
stem
public abstract java.lang.String stem(java.lang.String word)
Reduce the given input to its stem word- Parameters:
word- the unstemmed input word- Returns:
- the stemmed version of the word
-
applyTo
public void applyTo(java.util.List<java.lang.String> list)
Replaces each value in the list with the stemmed version of the word- Parameters:
list- the list to apply stemming to
-
applyTo
public void applyTo(java.lang.String[] arr)
Replaces each value in the array with the stemmed version of the word- Parameters:
arr- the array to apply stemming to
-
-
DataMelt 3.0 © DataMelt by jWork.ORG