Method: UniversalDetector::SingleByteCharSetProber#get_confidence

Defined in:
lib/SingleByteCharSetProber.rb

#get_confidenceObject



117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/SingleByteCharSetProber.rb', line 117

def get_confidence
    r = 0.01
    if @_mTotalSeqs > 0
    #            print @_mSeqCounters[POSITIVE_CAT], @_mTotalSeqs, @_mModel['mTypicalPositiveRatio']
        r = (1.0 * @_mSeqCounters[POSITIVE_CAT]) / @_mTotalSeqs / @_mModel['mTypicalPositiveRatio']
    #            print r, @_mFreqChar, @_mTotalChar
        r = r * @_mFreqChar / @_mTotalChar
        if r >= 1.0
            r = 0.99
        end
    end
    return r
end