Class Stemmer

Namespace
NOpenNLP.Tools.Stemmer.Snowball
Assembly
NOpenNLP.Tools.dll

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

StringBuilder

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

string

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

sb StringBuilder
index int
length int
text string

Returns

StringBuilder

Stem()

Stems the buffer's contents.

public bool Stem()

Returns

bool

Stem(string)

Stems a given word.

public string Stem(string word)

Parameters

word string

The 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

s StringBuilder

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

s string

Returns

bool

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

s string

Returns

bool

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

s StringBuilder

Returns

bool

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

v Among[]

Returns

int

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

v Among[]

Returns

int

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

s string
min int
max int
repeat bool

Returns

int

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

s string
min int
max int
repeat bool

Returns

int

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

c_bra int
c_ket int
s string

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_bra int
c_ket int
s StringBuilder

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

s string
min int
max int
repeat bool

Returns

int

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

s string
min int
max int
repeat bool

Returns

int

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

c_bra int
c_ket int
s string

Returns

int

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

s string

The s.

slice_to(StringBuilder)

Replaces the contents of the bracket with the string s.

protected void slice_to(StringBuilder s)

Parameters

s StringBuilder

stem()

Calls the stemmer to process the next word.

protected abstract bool stem()

Returns

bool