Method: UnicodeUtils.general_category

Defined in:
lib/unicode_utils/general_category.rb

.general_category(char) ⇒ Object

Get the long general category alias of char.

Example:

require "unicode_utils/general_category"
UnicodeUtils.general_category("A") # => :Uppercase_Letter

Returns a symbol if char is in the Unicode code point range, nil otherwise.

See also: UnicodeUtils.gc, UnicodeUtils.char_type

[View source]

22
23
24
# File 'lib/unicode_utils/general_category.rb', line 22

def general_category(char)
  GENERAL_CATEGORY_ALIAS_MAP[UnicodeUtils.gc(char)]
end