<commit_before>package com.jakubsprega.untestable.code.f;

import com.google.common.io.CharStreams;
import com.google.gson.Gson;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

/**
 * Google client
 *
 * @author jakubsprega
 */
public class GoogleClient {
    
    private static final String DEFAULT_GOOGLE_API_URL = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=";

    private final String googleApiUrl;
    private final Charset charset;

    public GoogleClient(String googleApiUrl, Charset charset) {
        this.googleApiUrl = googleApiUrl;
        this.charset = charset;
    }

    public GoogleClient() {
        this(DEFAULT_GOOGLE_API_URL, StandardCharsets.UTF_8);
    }

    public GoogleClient(String googleApiUrl) {
        this(googleApiUrl, StandardCharsets.UTF_8);
    }
    
    public GoogleClient(Charset charset) {
        this(DEFAULT_GOOGLE_API_URL, charset);
    }

    public GoogleResult search(String searchPhrase) throws Exception {
        String googleRequestUrl = String.format(<commit_msg>Improve google client<commit_after>package com.jakubsprega.untestable.code.f;

import com.google.common.io.CharStreams;
import com.google.gson.Gson;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.Charset;

/**
 * Google client
 *
 * @author jakubsprega
 */
public class GoogleClient {
    
    //Google api url
    //"http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=";

    private final String googleApiUrl;
    private final Charset charset;

    public GoogleClient(String googleApiUrl, Charset charset) {
        this.googleApiUrl = googleApiUrl;
        this.charset = charset;
    }

    public GoogleResult search(String searchPhrase) throws Exception {
        String googleRequestUrl = String.format(
{'fraction_non_alphanumeric': 0.09689119170984456, 'fraction_numerical': 0.0031088082901554403, 'mean_word_length': 3.686893203883495, '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': '3956168', 'n_tokens_mistral': 618, 'n_tokens_neox': 591, 'n_words': 121}