<commit_before>module Goodreads
  module Authors
    # Get author details
    #
    def author(id, params={})
      params[:id] = id
      data = request('/author/show', params)
      Hashie::Mash.new(data['author'])
    end

    # Search for an author by name
    #
    def author_by_name(name, params={})
      params[:id] = name
      data = request('/api/author_url', params)
      Hashie::Mash.new(data['author'])
    end
  end
end<commit_msg>inserting encoded name string in url<commit_after>module Goodreads
  module Authors
    # Get author details
    #
    def author(id, params={})
      params[:id] = id
      data = request('/author/show', params)
      Hashie::Mash.new(data['author'])
    end

    # Search for an author by name
    #
    def author_by_name(name, params={})
      params[:id] = name
      name_encoded = URI.encode(name)
      data = request("/api/author_url/#{name_encoded}", params)
      Hashie::Mash.new(data['author'])
    end
  end
end
{'fraction_non_alphanumeric': 0.13360739979445016, 'fraction_numerical': 0.0, 'mean_word_length': 2.7606177606177607, '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': '4488991', 'n_tokens_mistral': 310, 'n_tokens_neox': 305, 'n_words': 76}