Class RSLPStemmerBase
Base class for stemmers that use a set of RSLP-like stemming steps.
RSLP (Removedor de Sufixos da Lingua Portuguesa) is an algorithm designed
originally for stemming the Portuguese language, described in the paper
A Stemming Algorithm for the Portuguese Language, Orengo et. al.
Since this time a plural-only modification (RSLP-S) as well as a modification for the Galician language have been implemented. This class parses a configuration file that describes RSLPStemmerBase.Steps, where each RSLPStemmerBase.Step contains a set of RSLPStemmerBase.Rules.
The general rule format is:
{ "suffix", N, "replacement", { "exception1", "exception2", ...}}where:
- suffixis the suffix to be removed (such as "inho").
- Nis the min stem size, where stem is defined as the candidate stem after removing the suffix (but before appending the replacement!)
- replacementis an optimal string to append after removing the suffix. This can be the empty string.
- exceptionsis an optional list of exceptions, patterns that should not be stemmed. These patterns can be specified as whole word or suffix (ends-with) patterns, depending upon the exceptions format flag in the step header.
A step is an ordered list of rules, with a structure in this format:
{ "name", N, B, { "cond1", "cond2", ... } ... rules ... };where:
- nameis a name for the step (such as "Plural").
- Nis the min word size. Words that are less than this length bypass the step completely, as an optimization. Note: N can be zero, in this case this implementation will automatically calculate the appropriate value from the underlying rules.
- Bis a "boolean" flag specifying how exceptions in the rules are matched. A value of 1 indicates whole-word pattern matching, a value of 0 indicates that exceptions are actually suffixes and should be matched with ends-with.
- condsare an optional list of conditions to enter the step at all. If the list is non-empty, then a word must end with one of these conditions or it will bypass the step completely as an optimization.
Inheritance
Inherited Members
Namespace: Lucene.Net.Analysis.Pt
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public abstract class RSLPStemmerBaseMethods
| Improve this Doc View SourceParse(Type, String)
Parse a resource file into an RSLP stemmer description.
Declaration
protected static IDictionary<string, RSLPStemmerBase.Step> Parse(Type clazz, string resource)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Type | clazz | |
| System.String | resource | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IDictionary<System.String, RSLPStemmerBase.Step> | a Map containing the named RSLPStemmerBase.Steps in this description. |