<commit_before>//
//  String+Extension.swift
//  KnackerTemplate
//
//  Created by <NAME> on 2/11/16.
//  Copyright © 2016 misfit. All rights reserved.
//

import Foundation

infix operator ++ {}
public func ++(left: String, right: String) -> String {
    return (left as NSString).stringByAppendingPathComponent(right)
}<commit_msg>add string subscript to get range<commit_after>//
//  String+Extension.swift
//  KnackerTemplate
//
//  Created by <NAME> on 2/11/16.
//  Copyright © 2016 misfit. All rights reserved.
//

import Foundation

infix operator ++ {}
public func ++(left: String, right: String) -> String {
    return (left as NSString).stringByAppendingPathComponent(right)
}

public extension String {
    subscript (r: Range<Int>) -> String {
        get {
            let startIndex = advance(self.startIndex, r.startIndex)
            let endIndex = advance(startIndex, r.endIndex - r.startIndex)
            
            return self[Range(start: startIndex, end: endIndex)]
        }
    }
}
{'fraction_non_alphanumeric': 0.12611717974180736, 'fraction_numerical': 0.01787487586891758, 'mean_word_length': 2.8473282442748094, 'pattern_counts': {'":': 0, '<': 6, '<?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': '1443804', 'n_tokens_mistral': 317, 'n_tokens_neox': 297, 'n_words': 87}