<commit_before>//
//  QtMeasurement.swift
//  QTc_iOS
//
//  Created by <NAME> on 4/9/18.
//  Copyright © 2018 EP Studios. All rights reserved.
//

import Foundation

public enum IntervalRateType {
    case interval
    case rate
}

public enum Units {
    case msec
    case sec
}

// Wrap up the parameters needed to measure QTc and QTp
public struct QtMeasurement {
    var qt: Double? // an optional, since QT not needed for QTp
    var intervalRate: Double  // RR interval or HR
    var units: Units
    var intervalRateType: IntervalRateType // an interval or HR
    var sex: Sex
    var age: Int?  // truncate ages to Int, may be nil as not always needed
}<commit_msg>Add explicit init to QtMeasurement<commit_after>//
//  QtMeasurement.swift
//  QTc_iOS
//
//  Created by <NAME> on 4/9/18.
//  Copyright © 2018 EP Studios. All rights reserved.
//

import Foundation

public enum IntervalRateType {
    case interval
    case rate
}

public enum Units {
    case msec
    case sec
}

// Wrap up the parameters needed to measure QTc and QTp
public struct QtMeasurement {
    public let qt: Double? // an optional, since QT not needed for QTp
    public let intervalRate: Double  // RR interval or HR
    public let units: Units
    public let intervalRateType: IntervalRateType // an interval or HR
    public let sex: Sex
    public let age: Int?  // truncate ages to Int, may be nil as not always needed
    
    // In Swift, default init is interval, so must specifically declare public init
    public init(qt: Double?, intervalRate: Double, units: Units,
        intervalRateType: IntervalRateType, sex: Sex, age: Int?) {
        self.qt = qt
        self.intervalRate = intervalRate
        self.units = units
        self.intervalRateType = intervalRateType
        self.sex = sex
        self.age = age
    }
}
{'fraction_non_alphanumeric': 0.07510964912280702, 'fraction_numerical': 0.008771929824561403, 'mean_word_length': 2.5784313725490198, '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': '4916037', 'n_tokens_mistral': 562, 'n_tokens_neox': 526, 'n_words': 227}