<commit_before><commit_msg>initial display<commit_after>function display(matches) {
  var tags = Object.keys(matches);

  tags.forEach(function(tag) {
    var container      = document.createElement('ul'),
        sectionHeading = document.createTextNode(tag);
        container.appendChild(sectionHeading);
        container.id   = tag;


    var displayDiv = document.getElementById('display');
        displayDiv.appendChild(container);

    insertItems(container, matches[tag], 'li');
  });
}

// generic
function insertItems(parentElement, matchedItems, tagType) {
  matchedItems.forEach(function(matchedItem) {
    var newEl         = document.createElement(tagType),        // make element
        contentString = stringifyItemConents(matchedItem),      // stringify contents
        itemContents  = document.createTextNode(contentString); // make content

    newEl.appendChild(itemContents);  // add content to element
    parentElement.appendChild(newEl); // add element to DOM
  });
}


function stringifyItemConents(example) {
  var stringifiedContents = "";
  var keys = Object.keys(example);
  keys.forEach(function(key) {
    stringifiedContents += key + ": " + example[key] + "\n";
  });

  return stringifiedContents;
}
{'fraction_non_alphanumeric': 0.11812297734627832, 'fraction_numerical': 0.0, 'mean_word_length': 3.7213740458015265, 'pattern_counts': {'":': 1, '<': 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': '162727', 'n_tokens_mistral': 333, 'n_tokens_neox': 325, 'n_words': 65}