<commit_before>class PlayAsia::API
  def listing(opts = {})
    response = query(opts.merge({ query: :listing }))
    
    raise "Query error: '#{response.error_message}'" if response.error?
    
    response.content.search('item').map do |xml|
      item = {}
      xml.search('*').each do |node|
        item[node.name] = node.text
      end
      item
    end
  end
end<commit_msg>Added friendly mask parameter support<commit_after>class PlayAsia::API
  def listing(opts = {})
    opts = process_friendly_keys opts.merge({ query: :listing })
    response = query opts
    
    raise "Query error: '#{response.error_message}'" if response.error?
    
    response.content.search('item').map do |xml|
      item = {}
      xml.search('*').each do |node|
        item[node.name.to_sym] = node.text
      end
      item
    end
  end
  
  private
  MASK = {
    price: 'p',
    barcodes: 'j',
    manufacturer_codes: 'm',
    sale_info: 's',
    release_date: 'r',
    name: 'n',
    image: 'i',
    url: 'l',
    affiliate_url: 'a',
    genre: 'g',
    version: 'v',
    encoding: 'e',
    compatibility: 'c'
  }
  
  def process_friendly_keys opts
    if opts[:mask] && opts[:mask].is_a?(Array)
      opts[:mask] = opts[:mask].map { |k| MASK[k] || k }.join
    end
    opts
  end
end
{'fraction_non_alphanumeric': 0.15342679127725856, 'fraction_numerical': 0.0, 'mean_word_length': 2.510928961748634, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '5258947', 'n_tokens_mistral': 441, 'n_tokens_neox': 443, 'n_words': 106}