edu.mit.jwi.morph
Interface IStemmingRule

All Superinterfaces:
IHasPOS
All Known Implementing Classes:
StemmingRule

public interface IStemmingRule
extends IHasPOS

A rule for deriving a stem (a.k.a., root or lemma) from a word.

Since:
JWI 2.3.1
Version:
2.4.0
Author:
Mark A. Finlayson

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.
 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 interface edu.mit.jwi.item.IHasPOS
getPOS
 

Method Detail

getSuffix

java.lang.String getSuffix()
Returns the suffix for this rule. Will never return null, empty, or all whitespace.

Returns:
the suffix for this rule.
Since:
JWI 2.3.1

getEnding

java.lang.String getEnding()
Returns the ending for this rule. Will never return null , empty, or all whitespace.

Returns:
the ending for this rule.
Since:
JWI 2.3.1

getSuffixIgnoreSet

java.util.Set<java.lang.String> getSuffixIgnoreSet()
Returns the set of suffixes that should be ignored when applying this stemming rule. This method will never return null, but it may return an empty set. The ignore set will not include the string returned by getSuffix().

Returns:
a non-null but possibly empty set of suffixes to be ignored
Since:
JWI 2.3.1

apply

java.lang.String apply(java.lang.String word)
Applies this rule to the given word. The word should not be null, but may be empty. If the rule cannot be applied to the word, this method returns null. This call is equivalent to calling apply(String, String) with null as the second argument

Parameters:
word - the word to which the stemming rule should be applied.
Returns:
the root of the word, or null if the rule cannot be applied to this word
Since:
JWI 2.3.1

apply

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. If the rule cannot be applied to the word, this method returns null.

Parameters:
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.
Returns:
the root of the word, or null if the rule cannot be applied to this word
Since:
JWI 2.3.1


Copyright © 2007-2013 Massachusetts Institute of Technology. All Rights Reserved.