# File lib/Latin1Prober.rb, line 140 def get_confidence() if get_state() == :NotMe return 0.01 end total = @_mFreqCounter.reduce(:+, 0) 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