<commit_before>//
//  String+Rx.swift
//  Rx
//
//  Created by <NAME> on 12/25/15.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import Foundation

extension String {
    /**
     This is needed because on Linux Swift doesn't have `rangeOfString(..., options: .BackwardsSearch)`
    */
    func lastIndexOf(character: Character) -> Index? {
        var last: Index?
        for i in startIndex ..< endIndex {
            if self[i] == character {
                last = i
            }
        }

        return last
    }
}<commit_msg>Make lastIndexOf search from end of string to start<commit_after>//
//  String+Rx.swift
//  Rx
//
//  Created by <NAME> on 12/25/15.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import Foundation

extension String {
    /**
     This is needed because on Linux Swift doesn't have `rangeOfString(..., options: .BackwardsSearch)`
    */
    func lastIndexOf(character: Character) -> Index? {
        var index = endIndex
        while index > startIndex {
            index = index.predecessor()
            if self[index] == character {
                return index
            }
        }

        return nil
    }
}
{'fraction_non_alphanumeric': 0.11804961505560307, 'fraction_numerical': 0.01710863986313088, 'mean_word_length': 1.8057553956834533, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, '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': '2344026', 'n_tokens_mistral': 360, 'n_tokens_neox': 330, 'n_words': 108}