<commit_before>function HomeController(posts, $state) {
  var ctrl = this;

  ctrl.posts = posts.data;
  
  ctrl.$state = $state
  ctrl.home = function () {
    return $state.current.name === 'home';
  }
}

angular
  .module('app')
  .controller('HomeController', HomeController)<commit_msg>added filters to home page<commit_after>function HomeController(posts, categories, $scope, $state, $filter) {
  var ctrl = this;

  ctrl.posts = posts.data;
  ctrl.categories = categories.data;
  ctrl.filter = {};
  ctrl.filterByCategory = filterByCategory;

  ctrl.$state = $state
  ctrl.home = function () {
    return $state.current.name === 'home';
  }

  function filterByCategory(post) {
    return ctrl.filter[post.category.name] || noFilter(ctrl.filter);
  };

  function noFilter(filterObj) {
    return Object.
      keys(filterObj).
      every(function (key) { return !filterObj[key]; });
  }
}

angular
  .module('app')
  .controller('HomeController', HomeController)
{'fraction_non_alphanumeric': 0.1462409886714727, 'fraction_numerical': 0.0, 'mean_word_length': 3.86, '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': '3309309', 'n_tokens_mistral': 307, 'n_tokens_neox': 300, 'n_words': 63}