<commit_before>require 'httparty'

module DictionaryAPI

  class DictionaryAPI::Client

    attr_accessor :api_key

    BASE_URL = "https://dictionary.yandex.net/api/v1/dicservice.json/"

    def initialize(key)
      @api_key = key
    end

    def execute(path, options = {})
      response = HTTParty.get(self.build_url(path, options))    
      self.check_errors(response)
    end

  protected

    def check_errors(response)
      case response.code
      when 200 then response
      when 401 then raise 'Invalid API key'
      when 402 then raise 'API key blocked'
      when 403 then raise 'Daily limit of requests is exceeded'<commit_msg>Update client.rb<commit_after>require 'httparty'

module DictionaryAPI

  class DictionaryAPI::Client

    attr_accessor :api_key

    BASE_URL = "https://dictionary.yandex.net/api/v1/dicservice.json/"

    def initialize(key)
      @api_key = key
    end

    def execute(path, options = {})
      response = HTTParty.post(self.build_url(path, options))    
      self.check_errors(response)
    end

  protected

    def check_errors(response)
      case response.code
      when 200 then response
      when 401 then raise 'Invalid API key'
      when 402 then raise 'API key blocked'
      when 403 then raise 'Daily limit of requests is exceeded'
{'fraction_non_alphanumeric': 0.07935285053929121, 'fraction_numerical': 0.020030816640986132, 'mean_word_length': 2.900900900900901, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1435865', 'n_tokens_mistral': 420, 'n_tokens_neox': 375, 'n_words': 112}