<commit_before># Encapsulates a single regiong where UKHPI observations can be made

class Region
  attr_reader :uri, :type, :parent, :gss

  def initialize( uri, labels, type, parent, gss )
    @uri = uri
    @labels = labels
    @type = type
    @parent = parent
    @gss = gss
  end

  def matches_name?( name, rtype, lang = :en )
    @labels.any? {|key, label| key == lang && label.include?( name )} && type == rtype
  end

  def label( lang = :en )
    @labels[lang]
  end
end<commit_msg>Readability tweak<commit_after># Encapsulates a single regiong where UKHPI observations can be made

class Region
  attr_reader :uri, :type, :parent, :gss

  def initialize( uri, labels, type, parent, gss )
    @uri = uri
    @labels = labels
    @type = type
    @parent = parent
    @gss = gss
  end

  def matches_name?( name, rtype, lang = :en )
    type == rtype &&
    @labels.any? {|key, label| key == lang && label.include?( name )}
  end

  def label( lang = :en )
    @labels[lang]
  end
end
{'fraction_non_alphanumeric': 0.1227364185110664, 'fraction_numerical': 0.0, 'mean_word_length': 3.0120967741935485, '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': '2443756', 'n_tokens_mistral': 346, 'n_tokens_neox': 342, 'n_words': 118}