class TwitterCldr::Resources::Properties::UnicodeDataPropertiesImporter

Constants

DATA_FILE
PROPERTIES

Public Instance Methods

property_name() click to toggle source
# File lib/twitter_cldr/resources/properties/unicode_data_properties_importer.rb, line 25
def property_name
  PROPERTY_NAME
end

Private Instance Methods

load() click to toggle source
# File lib/twitter_cldr/resources/properties/unicode_data_properties_importer.rb, line 35
def load
  range_start = nil

  super do |data, ret|
    code_points = expand_range(data[0])

    # UnicodeData.txt can contain ranges of characters
    # specified with "First" and "Last" identifiers in
    # the name field.
    if data[1].include?(', First')
      range_start = code_points.first
      next
    elsif data[1].include?(', Last')
      code_points = (range_start..code_points.first).to_a
      range_start = nil
    end

    PROPERTIES.each_pair do |idx, property_name|
      property_value = format_property_value(data[idx])
      ret[property_name][property_value] += code_points
    end
  end
end
source_path() click to toggle source
# File lib/twitter_cldr/resources/properties/unicode_data_properties_importer.rb, line 31
def source_path
  requirements[:unicode].source_path_for(DATA_FILE)
end