stopwords-filter
stopwords-filter copied to clipboard
Argument error with Stopwords::Snowball::WordSieve.new
After updating from 0.4.1 to 0.7.0, initializing the Stopwords::Snowball::WordSieve
class produces the following error:
ArgumentError: Unknown locale: "fn"
I was able to get rid of the error by manually deleting the 'fn' file in lib/stopwords/snowball/locales folder.
Here's a helper method to do this at runtime for anyone using this gem in the future.
def fix_stopwords_locales!
dir = Gem::Specification.find_by_name("stopwords-filter").gem_dir
path = File.join(dir, "lib/stopwords/snowball/locales/fn.csv")
FileUtils.rm path if File.exist?(path)
end
I'll likely submit a pull request with a real fix to the maintained fork of this repo: https://github.com/aaronstillwell/stopwords-filter2