<commit_before>import UIKit
import AwfulBinding

public class BoundTableViewDelegate : NSObject, UITableViewDataSource, UITableViewDelegate{
    private var _bindableArray:PBindableCollection?
    public var bindableArray:PBindableCollection?{
        get{
            return _bindableArray
        }
        set(value){
            _bindableArray = value
            
            _bindableArray?.addChangedListener(self, listener:arrayChangedListener, alertNow: true)
            
            _bindableArray?.addIndexChangedListener(self, listener:indexChangedListener)
        }
    }
    
    public var deleteHandler:((indexPath:NSIndexPath) -> Void)?
    
    private func arrayChangedListener(){
        self.tableView?.reloadData()
    }
    
    private func indexChangedListener(indexChanged:Int){
        self.tableView?.reloadData()
    }
    
    public var tableView:UITableView?
    
    public func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return _bindableArray != nil ? _bindableArray!.count : 0
    }
    
    public func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 1
    }
    
    public var cellForRowAtIndexPath:((indexPath:NSIndexPath) -> UITableViewCell)?
    
    public func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        
        return cellForRowAtIndexPath != nil ? cellForRowAtIndexPath!(indexPath: indexPath) : UITableViewCell()
    }
    
    public func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
        return true
    }
    
    public func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
        switch(editingStyle)
        {
        case UITableViewCellEditingStyle.Delete:
            deleteHandler?(indexPath:indexPath)
            break
        default:
            break
        }
    }
}<commit_msg>Added selection listener to table delegate<commit_after>import UIKit
import AwfulBinding

public class BoundTableViewDelegate : NSObject, UITableViewDataSource, UITableViewDelegate{
    private var _bindableArray:PBindableCollection?
    public var bindableArray:PBindableCollection?{
        get{
            return _bindableArray
        }
        set(value){
            _bindableArray = value
            
            _bindableArray?.addChangedListener(self, listener:arrayChangedListener, alertNow: true)
            
            _bindableArray?.addIndexChangedListener(self, listener:indexChangedListener)
        }
    }
    
    public var deleteHandler:((indexPath:NSIndexPath) -> Void)?
    
    private func arrayChangedListener(){
        assert(tableView != nil, "tableView property cannot be nil.")
        
        self.tableView!.reloadData()
    }
    
    private func indexChangedListener(indexChanged:Int){
        assert(tableView != nil, "tableView property cannot be nil.")
        
        self.tableView!.reloadData()
    }
    
    public var tableView:UITableView?
    
    public func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return _bindableArray != nil ? _bindableArray!.count : 0
    }
    
    public func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 1
    }
    
    public var cellForRowAtIndexPath:((indexPath:NSIndexPath) -> UITableViewCell)?
    
    public func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        
        return cellForRowAtIndexPath != nil ? cellForRowAtIndexPath!(indexPath: indexPath) : UITableViewCell()
    }
    
    public func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
        return true
    }
    
    public func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
        switch(editingStyle)
        {
        case UITableViewCellEditingStyle.Delete:
            deleteHandler?(indexPath:indexPath)
            break
        default:
            break
        }
    }
    
    public var onSelect:((indexPath:NSIndexPath) -> Void)?
    
    public func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        onSelect?(indexPath: indexPath)
    }
}
{'fraction_non_alphanumeric': 0.07290729072907291, 'fraction_numerical': 0.0009000900090009, 'mean_word_length': 2.8618592528236317, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, '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': '5820254', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1161, 'n_words': 250}