<commit_before>/** Prettify JSON .*/
function prettifyJSON() {
    $.each( $('.prettify-json'), function() {
        var ugly = $(this).val();
        var obj = JSON.parse(ugly);
        var pretty = JSON.stringify(obj, undefined, 4);
        $(this).val(pretty);
        console.log(pretty);
    });
}


/** Populate value of radio buttons linked to text fields.*/
$('#answer-form').on('submit', function() {
    $('.radio-text-group').each(function() {
        var text = $(this).find('input[type=text]').val();
        $(this).find('input[type=radio]').val(text);
    });
});


$(document).ready(function() {
    prettifyJSON();
});<commit_msg>Add Z3950 search function<commit_after>/** Prettify JSON .*/
function prettifyJSON() {
    $.each( $('.prettify-json'), function() {
        var ugly = $(this).val();
        var obj = JSON.parse(ugly);
        var pretty = JSON.stringify(obj, undefined, 4);
        $(this).val(pretty);
        console.log(pretty);
    });
}


/** Populate value of radio buttons linked to text fields.*/
$('#answer-form').on('submit', function() {
    $('.radio-text-group').each(function() {
        var text = $(this).find('input[type=text]').val();
        $(this).find('input[type=radio]').val(text);
    });
});


/** Perform a Z39.50 search.*/
function z3950Search(query, callback) {
    $.ajax({
        type: 'GET',
        url: '/z3950/search/oclc/html',
        data: {query: query},
        success: function(results) {
            callback(results);
        }, error: function(err) {
            alert('Z3950 ERROR: ' + err.status + " " + err.statusText);
        }
    });
}


$(document).ready(function() {
    prettifyJSON();
});
{'fraction_non_alphanumeric': 0.2116875372689326, 'fraction_numerical': 0.01311866428145498, 'mean_word_length': 2.704194260485651, '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': '505752', 'n_tokens_mistral': 549, 'n_tokens_neox': 527, 'n_words': 105}