class Cadmium::PorterStemmer
- Cadmium::PorterStemmer
- Cadmium::Stemmer
- Reference
- Object
Defined in:
cadmium/stemmer/porter_stemmer.crClass Method Summary
-
.attempt_replace(token : String, pattern : String | Regex, replacement : String)
Attempt to replace a pattern in a word.
-
.attempt_replace(token : String, pattern : String | Regex, replacement : String, &)
Attempt to replae a pattern in a word.
-
.attempt_replace_patterns(token, replacements, measure_threshold = nil)
Attempt to replace a list of patterns/replacements on a token for a minimum measure M
- .categorize_chars(token : String)
- .categorize_groups(token : String)
- .ends_with_double_cons(token : String)
- .measure(token : String | Nil)
- .replace_patterns(token, replacements, measure_threshold = nil)
- .replace_regex(token, regex, include_parts, minimum_measure)
- .stem(token : String)
- .step1a(token : String)
- .step1b(token : String)
- .step1c(token : String)
- .step2(token : String)
- .step3(token : String)
- .step4(token : String)
- .step5a(token : String)
- .step5b(token : String)
Class methods inherited from class Cadmium::Stemmer
add_stop_word(word)
add_stop_word,
add_stop_words(words)
add_stop_words,
remove_stop_word(word)
remove_stop_word,
remove_stop_words(words)
remove_stop_words,
stem(token)
stem,
tokenize_and_stem(text, keep_stops = false)
tokenize_and_stem
Class Method Detail
def self.attempt_replace(token : String, pattern : String | Regex, replacement : String)
#
Attempt to replace a pattern in a word. if a replacement occurs the replacement is returned. Otherwise nil is returned.
def self.attempt_replace(token : String, pattern : String | Regex, replacement : String, &)
#
Attempt to replae a pattern in a word. If a replacement occurs the replacement is yielded to a block. Otherwise nil is returned
def self.attempt_replace_patterns(token, replacements, measure_threshold = nil)
#
Attempt to replace a list of patterns/replacements on a token for a minimum measure M