Module: Linguistics::EN::Stemmer
- Extended by:
- SingletonMethods
- Defined in:
- lib/linguistics/en/stemmer.rb
Overview
Ruby-Stemmer support for the English-language Linguistics module. It requires the Ruby-Stemmer gem to be installed; if it is not installed, calling the functions defined by this file will raise NotImplementedErrors.
# Test to be sure the Stemmer gem loaded okay.
Linguistics::EN.has_stemmer?
# => true
Defined Under Namespace
Modules: SingletonMethods
Class Method Summary collapse
-
.stemmer ⇒ Object
The instance of the Lingua::Stemmer used for all Linguistics Stemmer functions.
Instance Method Summary collapse
-
#stem ⇒ Object
Return the stem of the receiving word.
Methods included from SingletonMethods
Class Method Details
.stemmer ⇒ Object
The instance of the Lingua::Stemmer used for all Linguistics Stemmer functions.
54 55 56 57 |
# File 'lib/linguistics/en/stemmer.rb', line 54 def self::stemmer raise self.stemmer_error unless self.has_stemmer? @stemmer ||= Lingua::Stemmer.new end |
Instance Method Details
#stem ⇒ Object
Return the stem of the receiving word.
70 71 72 |
# File 'lib/linguistics/en/stemmer.rb', line 70 def stem return Linguistics::EN::Stemmer.stemmer.stem( self.obj.to_s ) end |