Class: UnicodeUtils::Impl::AfterIConditionalCasing

Inherits:
ConditionalCasing show all
Defined in:
lib/unicode_utils/conditional_casing.rb

Instance Attribute Summary

Attributes inherited from ConditionalCasing

#mapping

Instance Method Summary collapse

Methods inherited from ConditionalCasing

#initialize

Constructor Details

This class inherits a constructor from UnicodeUtils::Impl::ConditionalCasing

Instance Method Details

#context_match?(str, pos) ⇒ Boolean

Returns:

  • (Boolean)


67
68
69
70
71
72
73
74
75
# File 'lib/unicode_utils/conditional_casing.rb', line 67

def context_match?(str, pos)
  (pos - 1).downto(0) { |i|
    c = str[i]
    return true if c.ord == 0x49 # uppercase I
    cc = UnicodeUtils.combining_class(c)
    return false if cc == 0 || cc == 230
  }
  false # uppercase I not found
end