<commit_before>//
//  RainbowHexadecimalIntSeeker.swift
//  ColorSenseRainbow
//
//  Created by <NAME> on 2015-04-23.
//  Copyright (c) 2015 Northern Realities Inc. All rights reserved.
//

import AppKit

class RainbowHexadecimalIntSeeker: Seeker {

    override init () {
        super.init()
        
        
        var error : NSError?
        
        var regex: NSRegularExpression?
        
        
        // Swift
        
        let commonSwiftRegex = "(?:NS|UI)Color\\s*\\(\\s*hex:\\s*0x([0-9a-fA-F]{6})\\s*"
        
        do {
            regex = try NSRegularExpression ( pattern: commonSwiftRegex + ",\\s*alpha:\\s*" + swiftAlphaConst + "\\s*\\)", options: [])
        } catch let error1 as NSError {
            error = error1
            regex = nil
        }
        
        if regex == nil {
            print ( "Error creating Swift Rainbow hexidecimal int with alpha regex = \(error?.localizedDescription)" )
        } else {
            regexes.append( regex! )
        }
        
        <commit_msg>Add support for ".init" to match regex<commit_after>//
//  RainbowHexadecimalIntSeeker.swift
//  ColorSenseRainbow
//
//  Created by <NAME> on 2015-04-23.
//  Copyright (c) 2015 Northern Realities Inc. All rights reserved.
//

import AppKit

class RainbowHexadecimalIntSeeker: Seeker {

    override init () {
        super.init()
        
        
        var error : NSError?
        
        var regex: NSRegularExpression?
        
        
        // Swift
        
        let commonSwiftRegex = "(?:NS|UI)Color" + swiftInit + "\\s*\\(\\s*hex:\\s*0x([0-9a-fA-F]{6})\\s*"
        
        do {
            regex = try NSRegularExpression ( pattern: commonSwiftRegex + ",\\s*alpha:\\s*" + swiftAlphaConst + "\\s*\\)", options: [])
        } catch let error1 as NSError {
            error = error1
            regex = nil
        }
        
        if regex == nil {
            print ( "Error creating Swift Rainbow hexidecimal int with alpha regex = \(error?.localizedDescription)" )
        } else {
            regexes.append( regex! )
        }
        
        
{'fraction_non_alphanumeric': 0.1261904761904762, 'fraction_numerical': 0.017142857142857144, 'mean_word_length': 1.5938271604938272, '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': '3012739', 'n_tokens_mistral': 681, 'n_tokens_neox': 623, 'n_words': 150}