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

require "unicode_utils/read_cdata"

module UnicodeUtils

  JAMO_SHORT_NAME_MAP = Impl.read_names("jamo_short_names") # :nodoc:

  # The Jamo Short Name property of the given character (defaults
  # to nil).
  #
  # Example:
  #
  #   require "unicode_utils/jamo_short_name"
  #   UnicodeUtils.jamo_short_name("\u{1101}") => "GG"
  def jamo_short_name(char)
    JAMO_SHORT_NAME_MAP[char.ord]
  end
  module_function :jamo_short_name

end