<commit_before>//
//  Copyright (c) 2015 Itty Bitty Apps. All rights reserved.
//

import Foundation

struct CollectableCollection<I: Collectable>: Collection {
  typealias T = CollectableGroup<I>

  let items: [CollectableGroup<I>]

  init(items: RevertItems) {
    self.items = items.data.map { CollectableGroup<I>(dictionary: $0) }
  }

  subscript(indexPath: NSIndexPath) -> I {
    return self[indexPath.section][indexPath.row]
  }
}<commit_msg>So the table view section will be hidden if it contains no items. It may contain no items if it is only for new iOS features.<commit_after>//
//  Copyright (c) 2015 Itty Bitty Apps. All rights reserved.
//

import Foundation

struct CollectableCollection<I: Collectable>: Collection {
  typealias T = CollectableGroup<I>

  let items: [CollectableGroup<I>]

  init(items: RevertItems) {
    let unfilteredItems = items.data.map { CollectableGroup<I>(dictionary: $0) }
    self.items = unfilteredItems.filter { $0.countOfItems > 0 }
  }

  subscript(indexPath: NSIndexPath) -> I {
    return self[indexPath.section][indexPath.row]
  }
}
{'fraction_non_alphanumeric': 0.11336405529953918, 'fraction_numerical': 0.011059907834101382, 'mean_word_length': 4.098591549295775, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, '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': '3094556', 'n_tokens_mistral': 360, 'n_tokens_neox': 337, 'n_words': 96}