<commit_before>require 'json'
require 'dictionary_api/client'
require 'dictionary_api/parser'

module DictionaryAPI

	class DictionaryAPI

		attr_accessor :api_key

		def initialize(key)
			@api_key = key
		end

		def get_langs
			JSON.parse client.execute('getLangs').body
		end

		def lookup(lang, text)
			text.gsub!(' ', '%20')
			response= JSON.parse client.execute('lookup', {'lang'=>lang, 'text'=>text}).body
			parser = Parser.new
			parser.parse(response)
		end

	protected

		def client	
			@client ||= Client.new(api_key)
		end
	end 
end<commit_msg>commit<commit_after>require 'json'
require 'dictionary_api/client'
require 'dictionary_api/parser'

module DictionaryAPI

  class DictionaryAPI

    attr_accessor :api_key

    def initialize(key)
      @api_key = key
    end

    def get_langs
      JSON.parse client.execute('getLangs').body
    end

    def lookup(lang, text)
      text.gsub!(' ', '%20')
      response= JSON.parse client.execute('lookup', {'lang'=>lang, 'text'=>text}).body
      parser = Parser.new
      parser.parse(response)
    end

  protected

    def client  
      @client ||= Client.new(api_key)
    end
  end 
end
{'fraction_non_alphanumeric': 0.11764705882352941, 'fraction_numerical': 0.0034602076124567475, 'mean_word_length': 3.3496240601503757, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7209655', 'n_tokens_mistral': 418, 'n_tokens_neox': 374, 'n_words': 87}