<commit_before><commit_msg>added javascript folder in pulic dir to hold js files<commit_after>    var createTable = function(obj) {
      var maxLength = Math.max(Object.keys(obj.vNegTerms).length, Object.keys(obj.negTerms).length, Object.keys(obj.posTerms).length, Object.keys(obj.vPosTerms).length);
      if(maxLength > 4) maxLength = 4;
      returnText = '<tr><th colspan="2">' + 'Very Positve Terms' + '</th>'
      + '<th colspan="2">' + 'Positve Terms' + '</th>'
      + '<th colspan="2">' + 'Negative Terms' + '</th>'
      + '<th colspan="2">' + 'Very Negative Terms' + '</th>'
      + '<tr>';
      for (var i = 0; i < maxLength; i++) {
        returnText += "<tr><td> " + Object.keys(obj.vPosTerms)[i] + "</td>"
        + "<td>" + obj.vPosTerms[Object.keys(obj.vPosTerms)[i]] + '</td>'
        + "<td>" + Object.keys(obj.posTerms)[i] + "</td>"
        + "<td>" + obj.posTerms[Object.keys(obj.posTerms)[i]] + '</td>'
        + "<td>" + Object.keys(obj.negTerms)[i] + "</td>"
        + "<td>" + obj.negTerms[Object.keys(obj.negTerms)[i]] + '</td>'
        + '<td>' + Object.keys(obj.vNegTerms)[i] + "</td>"
        + "<td>" + obj.vNegTerms[Object.keys(obj.vNegTerms)[i]] + '</td>'
        + '</tr>';
      }
      returnText = returnText.replace(/undefined/g, " ");
      return returnText;
    };
    $(document).ready(function() {
      $(function(){
        var processText = '';
        var returnString = '';
        $("button[type='submit']").click(function(){
          $(".returnString").fadeIn(500);
          $(".returnString").empty();
          processText = $("#processText").val();
          $.post("/process", {text: processText}).done(function(data){
            $(".returnString").html(
              '<p>The sentiment of your text is ' + data.sentiment + '.<br>'
              + 'The words that are affecting the rating are and how many times they appear are:<br></p>'
              + '<table id="sentiment">'
              + createTable(data)
              + '</table>');
          });
        });
      });
    });
{'fraction_non_alphanumeric': 0.22064579256360078, 'fraction_numerical': 0.004892367906066536, 'mean_word_length': 2.4719864176570456, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 38, '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': '952284', 'n_tokens_mistral': 675, 'n_tokens_neox': 661, 'n_words': 126}