|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.getopt.stempel.Stemmer
Stemmer class is a convenient facade for other stemmer-related classes. The core stemming algorithm and its implementation is taken verbatim from the Egothor project ( www.egothor.org ).
Even though the stemmer tables supplied in the distribution package are built for Polish language, there is nothing language-specific here.
Field Summary | |
int |
MIN_LENGTH
Minimum length of input words to be processed. |
Constructor Summary | |
Stemmer()
Create a Stemmer using stemmer table loaded from resource path pointed to by System property org.getopt.stempel.table . |
|
Stemmer(java.lang.String stemmerTable)
Create a Stemmer using selected stemmer table |
|
Stemmer(Trie stemmer)
Create a Stemmer using pre-loaded stemmer table |
Method Summary | |
java.lang.String |
getTableResPath()
Return resource path to the stemmer table, or null if initialized with preloaded table. |
static void |
main(java.lang.String[] args)
Testing method. |
java.lang.String |
stem(java.lang.String word,
boolean hideMissing)
Stem a word. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public int MIN_LENGTH
Constructor Detail |
public Stemmer()
org.getopt.stempel.table
. If this
property is missing, it is assumed that the included
stemmer_2000.out
table is to be used.
public Stemmer(java.lang.String stemmerTable)
stemmerTable
- resource path to stemmer table. This resource will be
looked up using this class's ClassLoader.public Stemmer(Trie stemmer)
stemmer
- pre-loaded stemmer tableMethod Detail |
public java.lang.String getTableResPath()
public java.lang.String stem(java.lang.String word, boolean hideMissing)
word
- input word to be stemmed.hideMissing
- if true, and the stem could not be found, return the
input word. If false, return null in such case.
public static void main(java.lang.String[] args) throws java.lang.Exception
args
-
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |