Class Stemmer
Base class for Snowball's stemmer algorithms.
public abstract class Stemmer : Env
- Inheritance
-
Stemmer
- Derived
- Inherited Members
Constructors
Stemmer()
Initializes a new instance of the Stemmer class.
protected Stemmer()
Properties
Buffer
Gets the current processing buffer.
public StringBuilder Buffer { get; }
Property Value
Current
Gets or sets the current word to be stemmed or the stemmed word, if the stemmer has been processed.
public string Current { get; set; }
Property Value
Methods
Replace(StringBuilder, int, int, string)
Replaces a specific region of the buffer with another text.
public static StringBuilder Replace(StringBuilder sb, int index, int length, string text)
Parameters
sbStringBuilderindexintlengthinttextstring
Returns
Stem()
Stems the buffer's contents.
public bool Stem()
Returns
Stem(string)
Stems a given word.
public string Stem(string word)
Parameters
wordstringThe word to be stemmed.
Returns
- string
The stemmed word.
assign_to(StringBuilder)
Replaces the contents of the bracket with the string s.
protected void assign_to(StringBuilder s)
Parameters
eq_s(string)
Determines if the current buffer contains the string s, starting from the current position and going forward.
protected bool eq_s(string s)
Parameters
sstring
Returns
eq_s_b(string)
Determines if the current buffer contains the string s, starting from the current position and going backwards.
protected bool eq_s_b(string s)
Parameters
sstring
Returns
eq_s_b(StringBuilder)
Determines if the current buffer contains the string s, starting from the current position and going backwards.
protected bool eq_s_b(StringBuilder s)
Parameters
Returns
find_among(Among[])
Searches if the current buffer matches against one of the amongs, starting from the current cursor position and going forward.
protected int find_among(Among[] v)
Parameters
vAmong[]
Returns
find_among_b(Among[])
Searches if the current buffer matches against one of the amongs, starting from the current cursor position and going backwards.
protected int find_among_b(Among[] v)
Parameters
vAmong[]
Returns
in_grouping(string, int, int, bool)
Determines whether the current character is
inside a given group of characters s.
protected int in_grouping(string s, int min, int max, bool repeat)
Parameters
Returns
in_grouping_b(string, int, int, bool)
Determines whether the current character is
inside a given group of characters s.
protected int in_grouping_b(string s, int min, int max, bool repeat)
Parameters
Returns
insert(int, int, string)
Replaces the contents of the bracket with the string s.
protected void insert(int c_bra, int c_ket, string s)
Parameters
insert(int, int, StringBuilder)
Replaces the contents of the bracket with the string s.
protected void insert(int c_bra, int c_ket, StringBuilder s)
Parameters
c_braintc_ketintsStringBuilder
out_grouping(string, int, int, bool)
Determines whether the current character is
outside a given group of characters s.
protected int out_grouping(string s, int min, int max, bool repeat)
Parameters
Returns
out_grouping_b(string, int, int, bool)
Determines whether the current character is
outside a given group of characters s.
protected int out_grouping_b(string s, int min, int max, bool repeat)
Parameters
Returns
replace_s(int, int, string)
Replaces the characters between c_bra
and c_ket by the characters in s.
protected int replace_s(int c_bra, int c_ket, string s)
Parameters
Returns
slice_check()
Checks if a slicing can be done.
protected void slice_check()
slice_del()
Removes the current bracket contents.
protected void slice_del()
slice_from(string)
Replaces the contents of the bracket with the string s.
protected void slice_from(string s)
Parameters
sstringThe s.
slice_to(StringBuilder)
Replaces the contents of the bracket with the string s.
protected void slice_to(StringBuilder s)
Parameters
stem()
Calls the stemmer to process the next word.
protected abstract bool stem()