Class: CharDet::EUCTWDistributionAnalysis
Instance Method Summary
collapse
#feed, #got_enough_data, #reset
Constructor Details
101
102
103
104
105
106
|
# File 'lib/rchardet/chardistribution.rb', line 101
def initialize
super()
@charToFreqOrder = EUCTWCharToFreqOrder
@tableSize = EUCTW_TABLE_SIZE
@typicalDistributionRatio = EUCTW_TYPICAL_DISTRIBUTION_RATIO
end
|
Instance Method Details
#get_confidence ⇒ Object
121
122
123
124
125
126
127
|
# File 'lib/rchardet/chardistribution.rb', line 121
def get_confidence
if @freqChars <= MINIMUM_DATA_THRESHOLD
return SURE_NO
end
super
end
|
#get_order(aStr) ⇒ Object
108
109
110
111
112
113
114
115
116
117
118
119
|
# File 'lib/rchardet/chardistribution.rb', line 108
def get_order(aStr)
if aStr[0, 1] >= "\xC4"
bytes = aStr.bytes.to_a
return 94 * (bytes[0] - 0xC4) + bytes[1] - 0xA1
else
return -1
end
end
|