<commit_before># frozen_string_literal: true

module AccountAreaHelper
  json_file_path = "#{Rails.root}/app/assets/javascripts/area_settings.json"
  conf = open(json_file_path) do |io|
    JSON.load(io)
  end
  HUMAN_AREAS = conf["areas"]

  def human_area(area_id)
    HUMAN_AREAS[area_id]["area-name"]
  end

  def get_area_eng_name(area_id)
    HUMAN_AREAS[area_id]["area-eng-name"]
  end

  def get_area_short_name(area_id)
    HUMAN_AREAS[area_id]["area-short-name"]
  end

  def area_id_list
    Array(0...HUMAN_AREAS.length)
  end

end
<commit_msg>area id と設定の表示順序を分離<commit_after># frozen_string_literal: true

module AccountAreaHelper
  json_file_path = "#{Rails.root}/app/assets/javascripts/area_settings.json"
  conf = open(json_file_path) do |io|
    JSON.load(io)
  end
  HUMAN_AREAS = conf["areas"]
  HUMAN_AREA_IDS = {}
  HUMAN_AREAS.each do |area|
    HUMAN_AREA_IDS[area["area-id"]] = area
  end


  def human_area(area_id)
    HUMAN_AREA_IDS[area_id]["area-name"]
  end

  def get_area_eng_name(area_id)
    HUMAN_AREA_IDS[area_id]["area-eng-name"]
  end

  def get_area_short_name(area_id)
    HUMAN_AREA_IDS[area_id]["area-short-name"]
  end

  def get_area_id_from_area_no(area_no)
    HUMAN_AREAS[area_no]["area-id"]
  end

  def area_id_list
    HUMAN_AREA_IDS.keys
  end

end

{'fraction_non_alphanumeric': 0.10866372980910426, 'fraction_numerical': 0.0007342143906020558, 'mean_word_length': 3.5433333333333334, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7038793', 'n_tokens_mistral': 623, 'n_tokens_neox': 568, 'n_words': 77}