vendor/bundle/ruby/2.5.0/gems/classifier-reborn-2.2.0/lib/classifier-reborn/bayes.rb
# Overwrites the default stopwords for current language with supplied list of stopwords or file
Overwrites the default stopwords for current language with supplied list of stopwords or file
Overwrites the default stopwords for current language with supplied list of stopwords or file
def custom_stopwords(stopwords)
      unless stopwords.is_a?(Enumerable)
        if stopwords.strip.empty?
          stopwords = []
        elsif File.exist?(stopwords)
          stopwords = File.read(stopwords).force_encoding("utf-8").split
        else
          return 
        end
      end
      Hasher::STOPWORDS[@language] = Set.new stopwords
    end
def custom_stopwords ( stopwords ) unless stopwords . is_a? ( Enumerable ) if stopwords . strip . empty? stopwords = [ ] elsif File . exist? ( stopwords ) stopwords = File . read ( stopwords ) . force_encoding ( "utf-8" ) . split else return end end Hasher :: STOPWORDS [ @language ] = Set . new stopwords end
Overwrites the default stopwords for current language with supplied list of stopwords or file
Overwrites the default stopwords for current language with supplied list of stopwords or file
# Do not overwrite the default
stopwords
<not_specific>