|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.mit.jwi.morph.StemmingRule
public class StemmingRule
Default implementation of the IStemmingRule
interface.
Constructor Summary | |
---|---|
StemmingRule(java.lang.String suffix,
java.lang.String ending,
POS pos,
java.lang.String... ignore)
Creates a new stemming rule with the specified suffix, ending, and avoid set |
Method Summary | |
---|---|
java.lang.String |
apply(java.lang.String word)
Applies this rule to the given word. |
java.lang.String |
apply(java.lang.String word,
java.lang.String suffix)
Applies this rule to the given word, adding the specified suffix to the end of the returned string. |
java.lang.String |
getEnding()
Returns the ending for this rule. |
POS |
getPOS()
Returns the associated part of speech for this object. |
java.lang.String |
getSuffix()
Returns the suffix for this rule. |
java.util.Set<java.lang.String> |
getSuffixIgnoreSet()
Returns the set of suffixes that should be ignored when applying this stemming rule. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StemmingRule(java.lang.String suffix, java.lang.String ending, POS pos, java.lang.String... ignore)
suffix
- the suffix that should be stripped from a word; should not
be null
, empty, or all whitespace.ending
- the ending that should be stripped from a word; should not
be null
, but may be empty or all whitespace.pos
- the part of speech to which this rule applies, may not be
null
ignore
- the set of suffixes that, when present, indicate this rule
should not be applied. May be null or empty, but not
contain nulls or empties.
java.lang.NullPointerException
- if the suffix, ending, or pos are null, or the ignore set
contains null
java.lang.NullPointerException
- if the suffix is empty or all whitespace, or the ignore
set contains a string which is empty or all whitespaceMethod Detail |
---|
public java.lang.String getSuffix()
IStemmingRule
null
,
empty, or all whitespace.
getSuffix
in interface IStemmingRule
public java.lang.String getEnding()
IStemmingRule
null
,
empty, or all whitespace.
getEnding
in interface IStemmingRule
public java.util.Set<java.lang.String> getSuffixIgnoreSet()
IStemmingRule
null
, but it
may return an empty set. The ignore set will not include the string
returned by IStemmingRule.getSuffix()
.
getSuffixIgnoreSet
in interface IStemmingRule
null
but possibly empty set of suffixes to be
ignoredpublic POS getPOS()
IHasPOS
null
.
getPOS
in interface IHasPOS
null
if none.public java.lang.String apply(java.lang.String word)
IStemmingRule
null
, but may be empty. If the rule cannot be applied to the
word, this method returns null
. This call is equivalent to
calling IStemmingRule.apply(String, String)
with null
as the
second argument
apply
in interface IStemmingRule
word
- the word to which the stemming rule should be applied.
null
if the rule cannot be
applied to this wordpublic java.lang.String apply(java.lang.String word, java.lang.String suffix)
IStemmingRule
null
.
apply
in interface IStemmingRule
word
- the word to which the stemming rule should be applied.suffix
- a suffix that should be appended to the root once it has been
derived; may be null
.
null
if the rule cannot be
applied to this word
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |