instance method get_confidence

Ruby on Rails 2.3.18

Since v2.3.18 Last seen in v2.3.18

Signature

get_confidence()

No documentation comment.

Source
# File actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/latin1prober.rb, line 127
    def get_confidence
      if get_state() == ENotMe
        return 0.01
      end

      total = @_mFreqCounter.inject{|a,b| a+b} 
      if total < 0.01
        confidence = 0.0
      else
        confidence = (@_mFreqCounter[3] / total) - (@_mFreqCounter[1] * 20.0 / total)
      end
      if confidence < 0.0
        confidence = 0.0
      end
      # lower the confidence of latin1 so that other more accurate detector 
      # can take priority.
      confidence = confidence * 0.5
      return confidence
    end

Defined in actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/latin1prober.rb line 127 · View on GitHub · Improve this page · Find usages on GitHub

Defined in CharDet::Latin1Prober

Type at least 2 characters to search.

↑↓ navigate · open · esc close