<commit_before><commit_msg>Added subscript extensions for String.<commit_after>//
//  String+Extensions.swift
//  Photostream
//
//  Created by <NAME> on 17/08/2016.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation

extension String {

    subscript (i: Int) -> Character {
        return self[self.startIndex.advancedBy(i)]
    }
    
    subscript (i: Int) -> String {
        return String(self[i] as Character)
    }
    
    subscript (r: Range<Int>) -> String {
        let start = startIndex.advancedBy(r.startIndex)
        let end = start.advancedBy(r.endIndex - r.startIndex)
        return self[Range(start ..< end)]
    }
}
{'fraction_non_alphanumeric': 0.13221884498480244, 'fraction_numerical': 0.0182370820668693, 'mean_word_length': 2.5240641711229945, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '2490139', 'n_tokens_mistral': 219, 'n_tokens_neox': 203, 'n_words': 51}