File: case_ignorable_char_q.rb

package info (click to toggle)
ruby-unicode-utils 1.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,988 kB
  • sloc: ruby: 1,877; makefile: 4
file content (16 lines) | stat: -rw-r--r-- 394 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# -*- encoding: utf-8 -*-

require "unicode_utils/read_cdata"

module UnicodeUtils

  CASE_IGNORABLE_SET = Impl.read_code_point_set("case_ignorable_set") # :nodoc:

  # Returns true if the given character is case-ignorable as defined
  # by Unicode 5.0, section 3.13.
  def case_ignorable_char?(char)
    CASE_IGNORABLE_SET.include?(char.ord)
  end
  module_function :case_ignorable_char?

end