File: combining_class.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 (17 lines) | stat: -rw-r--r-- 383 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# -*- encoding: utf-8 -*-

require "unicode_utils/read_cdata"

module UnicodeUtils

  COMBINING_CLASS_MAP = Impl.read_combining_class_map() # :nodoc:
  COMBINING_CLASS_MAP.default = 0

  # Get the combining class of the given character as an integer in
  # the range 0..255.
  def combining_class(char)
    COMBINING_CLASS_MAP[char.ord]
  end
  module_function :combining_class

end