<commit_before>
var _app = new app();

_app.initGui = function() {
    //alert("App Ready");   
}

_app.formSubmission = function (event) {
   event.preventDefault();
   var val = document.getElementById("inputarea").value;
   var params = [
       {'name': 'key', value:'<KEY>'},
       {'name': 'txt', value:val}
   ];
    console.log("Got Submission");
    _app.nimble.get(0, _app.formSubmissionHandler, true, params);
}

_app.formSubmissionHandler = function (data){
   var json = JSON.parse(data);
   var pages = json.ListPage.pages.LinkPage;
   
   var output = document.getElementById("inputarea").value;  

   for (i=(pages.length-1);i>=0;i--) {
       var p = pages[i];
       var lt =  p['linkTitle'].split('-');
       var start = parseInt(lt[0]);
       var end = parseInt(lt[1])+1;
       output = output.slice(0,start) + "<span id='" +p['@attributes']['id']+ "'>" + output.slice(start,end) 
           + "</span>" + output.slice(end,output.length);
       console.log(output);
       
   }
    
    document.getElementById("output").innerHTML = output;
}

_app.audioSubmission = function (file) {
   var val = document.getElementById("inputarea").value;
   var params = [
       {'name': 'key', value:'<KEY>'},
       {'name': 'txt', value:val}
   ];
    console.log("Got Submission");
    _app.nimble.getWithFile(file, _app.audioSubmissionHandler,0, true, params);
}

_app.audioSubmissionHandler = function (data){
   var json = JSON.parse(data);
    console.log(json);
   var output = document.getElementById("inputarea").value;
    
}


_app.initialize();<commit_msg>well yeah i added audio submi to api<commit_after>
var _app = new app();

_app.initGui = function() {
    //alert("App Ready");   
}

_app.formSubmission = function (event) {
   event.preventDefault();
   var val = document.getElementById("inputarea").value;
   var params = [
       {'name': 'key', value:'<KEY>'},
       {'name': 'txt', value:val}
   ];
    console.log("Got Submission");
    _app.nimble.get(0, _app.formSubmissionHandler, true, params);
}

_app.formSubmissionHandler = function (data){
   var json = JSON.parse(data);
   var pages = json.ListPage.pages.LinkPage;
   
   var output = document.getElementById("inputarea").value;  

   for (i=(pages.length-1);i>=0;i--) {
       var p = pages[i];
       var lt =  p['linkTitle'].split('-');
       var start = parseInt(lt[0]);
       var end = parseInt(lt[1])+1;
       output = output.slice(0,start) + "<span id='" +p['@attributes']['id']+ "'>" + output.slice(start,end) 
           + "</span>" + output.slice(end,output.length);
       console.log(output);
       
   }
    
    document.getElementById("output").innerHTML = output;
}

_app.audioSubmission = function (file) {
   var params = [
       {'name': 'key', value:'<KEY>'}
   ];
    console.log("Got Submission");
    _app.nimble.getWithFile(file, _app.audioSubmissionHandler,0, true, params);
}

_app.audioSubmissionHandler = function (data){
   var json = JSON.parse(data);
    console.log(json);
    
}


_app.initialize();
{'fraction_non_alphanumeric': 0.1809805857189865, 'fraction_numerical': 0.0052648897663705166, 'mean_word_length': 3.2222222222222223, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '5056237', 'n_tokens_mistral': 1009, 'n_tokens_neox': 1008, 'n_words': 193}