instance method
get_charset_name
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v2.3.18Signature
get_charset_name()
No documentation comment.
Source
# File actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/hebrewprober.rb, line 252
def get_charset_name
# Make the decision: is it Logical or Visual?
# If the final letter score distance is dominant enough, rely on it.
finalsub = @_mFinalCharLogicalScore - @_mFinalCharVisualScore
if finalsub >= MIN_FINAL_CHAR_DISTANCE
return LOGICAL_HEBREW_NAME
end
if finalsub <= -MIN_FINAL_CHAR_DISTANCE
return VISUAL_HEBREW_NAME
end
# It's not dominant enough, try to rely on the model scores instead.
modelsub = @_mLogicalProber.get_confidence() - @_mVisualProber.get_confidence()
if modelsub > MIN_MODEL_DISTANCE
return LOGICAL_HEBREW_NAME
end
if modelsub < -MIN_MODEL_DISTANCE
return VISUAL_HEBREW_NAME
end
# Still no good, back to final letter distance, maybe it'll save the day.
if finalsub < 0.0
return VISUAL_HEBREW_NAME
end
# (finalsub > 0 - Logical) or (don't know what to do) default to Logical.
return LOGICAL_HEBREW_NAME
end
Defined in actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/hebrewprober.rb line 252
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in CharDet::HebrewProber