Class: Stopwords::Snowball::Filter
- Defined in:
- lib/stopwords/snowball/filter.rb
Instance Attribute Summary collapse
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#locale_filename ⇒ Object
readonly
Returns the value of attribute locale_filename.
Attributes inherited from Filter
Instance Method Summary collapse
-
#initialize(locale, custom_list = []) ⇒ Filter
constructor
A new instance of Filter.
Methods inherited from Filter
Constructor Details
#initialize(locale, custom_list = []) ⇒ Filter
Returns a new instance of Filter.
7 8 9 10 11 12 13 |
# File 'lib/stopwords/snowball/filter.rb', line 7 def initialize locale, custom_list = [] @locale = locale @locale_filename = "#{File.dirname(__FILE__)}/locales/#{locale}.csv" raise "Unknown locale" unless File.exists?(@locale_filename) super File.read(@locale_filename).split(",") + custom_list end |
Instance Attribute Details
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
4 5 6 |
# File 'lib/stopwords/snowball/filter.rb', line 4 def locale @locale end |
#locale_filename ⇒ Object (readonly)
Returns the value of attribute locale_filename.
5 6 7 |
# File 'lib/stopwords/snowball/filter.rb', line 5 def locale_filename @locale_filename end |