<commit_before>module Cldr
  module Export
    module Data
      class Variables < Base

        # only these variables will be exported
        VARIABLE_IDS = %w($grandfathered)

        def initialize
          super(nil)
          update(:variables => variables)
        end

        private

        def variables
          doc.xpath('//validity/variable').inject({}) do |ret, variable|
            name = variable.attribute('id').value
            if VARIABLE_IDS.include?(name)
              ret[fix_var_name(name)] = split_value_list(variable.text)
            end
            ret
          end
        end

        def fix_var_name(var_name)
          # remove leading dollar sign
          var_name.sub(/\A\$/, '')
        end<commit_msg>Add a few more variables<commit_after>module Cldr
  module Export
    module Data
      class Variables < Base

        # only these variables will be exported
        VARIABLE_IDS = %w($grandfathered $language $territory $script $variant)

        def initialize
          super(nil)
          update(:variables => variables)
        end

        private

        def variables
          doc.xpath('//validity/variable').inject({}) do |ret, variable|
            name = variable.attribute('id').value
            if VARIABLE_IDS.include?(name)
              ret[fix_var_name(name)] = split_value_list(variable.text)
            end
            ret
          end
        end

        def fix_var_name(var_name)
          # remove leading dollar sign
          var_name.sub(/\A\$/, '')
        end
{'fraction_non_alphanumeric': 0.0881399870382372, 'fraction_numerical': 0.0, 'mean_word_length': 1.7135325131810193, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4311974', 'n_tokens_mistral': 423, 'n_tokens_neox': 406, 'n_words': 103}