<commit_before>//
//  JLDocumentScope.swift
//  Chromatism
//
//  Created by <NAME> on 2014-07-20.
//  Copyright (c) 2014 anviking. All rights reserved.
//

import UIKit

public class JLDocumentScope: JLScope {
    
    init() {
        super.init()
    }
    
    override func perform()  {
        indexSet.enumerateRangesUsingBlock({(range, stop) in
            if let color = self.theme?[.Text] {
                self.attributedString.addAttribute(NSForegroundColorAttributeName, value: color, range: range)
            }
            })
        super.perform()
    }
    
    func cascadeAttributedString(attributedString: NSMutableAttributedString) {
        self.attributedString = attributedString
        cascade { $0.attributedString = attributedString }<commit_msg>Oops! Document scope should use perform(indexSet) instead<commit_after>//
//  JLDocumentScope.swift
//  Chromatism
//
//  Created by <NAME> on 2014-07-20.
//  Copyright (c) 2014 anviking. All rights reserved.
//

import UIKit

public class JLDocumentScope: JLScope {
    
    init() {
        super.init()
    }
    
    override func perform(indexSet: NSIndexSet)  {
        indexSet.enumerateRangesUsingBlock({(range, stop) in
            if let color = self.theme?[.Text] {
                self.attributedString.addAttribute(NSForegroundColorAttributeName, value: color, range: range)
            }
            })
        super.perform(indexSet)
    }
    
    func cascadeAttributedString(attributedString: NSMutableAttributedString) {
        self.attributedString = attributedString
        cascade { $0.attributedString = attributedString }
{'fraction_non_alphanumeric': 0.09864364981504316, 'fraction_numerical': 0.016029593094944512, 'mean_word_length': 2.482832618025751, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5205976', 'n_tokens_mistral': 515, 'n_tokens_neox': 468, 'n_words': 101}