<commit_before>'use strict';

(function(module){

  const resultsView = {};

  resultsView.index = function() {
    //render results?
    Official.all.forEach(function(official){
      console.log('about to call toHtml');
      $('#resultsBox').append(official.toHtml())
    })
  };

  resultsView.filter = function() {
    //this needs to go somewhere else, just an idea
    // $('.resultsNav').on('click', function() {
    //   let selectedDivLevel = $(this).id? //get the id of the tab you click
    //   resultsView.filter(selectedDivLevel)
    // })

    // $('#resultsBox').empty();
    let allOfficials = Official.all;
    let selectedDivLevel = 'country'; //will need to be dynamic based on tab they click, then delete this.

    let filteredOfficials = allOfficials.filter(function(official) {
      console.log(selectedDivLevel);
      return (official.divFormatted.divLevel === selectedDivLevel);
    })
    filteredOfficials.forEach(function(official){
      $('#federalResults').append(official.toHtml());
    })
  };

  module.resultsView = resultsView;
})(window);
<commit_msg>completed filters<commit_after>'use strict';

(function(module){

  const resultsView = {};

  resultsView.index = function() {
    //render results?
    Official.all.forEach(function(official){
      console.log('about to call toHtml');
      $('#resultsBox').append(official.toHtml())
    })
  };

  resultsView.filter = function() {
    //this needs to go somewhere else, just an idea
    // $('.resultsNav').on('click', function() {
    //   let selectedDivLevel = $(this).id? //get the id of the tab you click
    //   resultsView.filter(selectedDivLevel)
    // })

    // $('#resultsBox').empty();
    let allOfficials = Official.all;
    let selectedDivLevel = 'country'; //will need to be dynamic based on tab they click, then delete this.

    let filteredOfficials = allOfficials.filter(function(official) {
      console.log(selectedDivLevel);
      return (official.divFormatted.divLevel === selectedDivLevel);
    })
    filteredOfficials.forEach(function(official){
      $('#federalResults').append(official.toHtml());
    })

    selectedDivLevel = 'state'; //will need to be dynamic based on tab they click, then delete this.

    filteredOfficials = allOfficials.filter(function(official) {
      console.log(selectedDivLevel);
      return (official.divFormatted.divLevel === selectedDivLevel);
    })
    filteredOfficials.forEach(function(official){
      $('#stateResults').append(official.toHtml());
    })

    selectedDivLevel = 'county'; //will need to be dynamic based on tab they click, then delete this.

    filteredOfficials = allOfficials.filter(function(official) {
      console.log(selectedDivLevel);
      return (official.divFormatted.divLevel === selectedDivLevel);
    })
    filteredOfficials.forEach(function(official){
      $('#ccResults').append(official.toHtml());
    })

    $('#resultsBox').hide();
  };



  module.resultsView = resultsView;
})(window);

{'fraction_non_alphanumeric': 0.14619492656875835, 'fraction_numerical': 0.0, 'mean_word_length': 3.4798206278026904, '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': '2214280', 'n_tokens_mistral': 873, 'n_tokens_neox': 819, 'n_words': 192}