Class: UnicodeUtils::Impl::BeforeDotConditionalCasing

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

Direct Known Subclasses

NotBeforeDotConditionalCasing

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)

31
32
33
34
35
36
37
38
39
# File 'lib/unicode_utils/conditional_casing.rb', line 31

def context_match?(str, pos)
  (pos + 1).upto(str.length - 1) { |i|
    c = str[i]
    return true if c.ord == 0x0307
    cc = UnicodeUtils.combining_class(c)
    return false if cc == 0 || cc == 230
  }
  false # "combining dot above" not found
end