<commit_before>import Foundation

public struct Version: CustomStringConvertible, Equatable {

    public var major: UInt
    public var minor: UInt
    public var patch: UInt

    public init(_ string: String) throws {
        let components = try string.split(separator: ".").map { (componentString) -> UInt in
            guard let uint = UInt(componentString) else {
                throw SpecParsingError.invalidVersion(string)
            }
            return uint
        }
        major = components[0]
        minor = (components.count >= 2) ? components[1] : 0
        patch = (components.count == 3) ? components[2] : 0
    }

    public init(_ double: Double) throws {
        try self.init(String(double))
    }

    public init(major: UInt, minor: UInt? = 0, patch: UInt? = 0) {
        self.major = major
        self.minor = minor ?? 0
        self.patch = patch ?? 0
    }

    public var string: String {
        return "\(major).\(minor).\(patch)"
    }

    public var description: String {
        return string
    }

    public func bumpingMajor() -> Version {
        return Version(major: major + 1, minor: 0, patch: 0)
    }

    public func bumpingMinor() -> Version {
        return Version(major: major, minor: minor + 1, patch: 0)
    }

    public func bumpingPatch() -> Version {
        return Version(major: major, minor: minor, patch: patch + 1)
    }
}
<commit_msg>Conform `Version` to `Comparable`<commit_after>import Foundation

public struct Version: CustomStringConvertible, Equatable, Comparable {
    
    public var major: UInt
    public var minor: UInt
    public var patch: UInt

    public init(_ string: String) throws {
        let components = try string.split(separator: ".").map { (componentString) -> UInt in
            guard let uint = UInt(componentString) else {
                throw SpecParsingError.invalidVersion(string)
            }
            return uint
        }
        major = components[0]
        minor = (components.count >= 2) ? components[1] : 0
        patch = (components.count == 3) ? components[2] : 0
    }

    public init(_ double: Double) throws {
        try self.init(String(double))
    }

    public init(major: UInt, minor: UInt? = 0, patch: UInt? = 0) {
        self.major = major
        self.minor = minor ?? 0
        self.patch = patch ?? 0
    }

    public var string: String {
        return "\(major).\(minor).\(patch)"
    }

    public var description: String {
        return string
    }

    public func bumpingMajor() -> Version {
        return Version(major: major + 1, minor: 0, patch: 0)
    }

    public func bumpingMinor() -> Version {
        return Version(major: major, minor: minor + 1, patch: 0)
    }

    public func bumpingPatch() -> Version {
        return Version(major: major, minor: minor, patch: patch + 1)
    }
    
    public static func < (lhs: Version, rhs: Version) -> Bool {
        guard lhs.major == rhs.major else { return lhs.major < rhs.major }
        guard lhs.minor == rhs.minor else { return lhs.minor < rhs.minor }
        return lhs.patch < rhs.patch
    }
}

{'fraction_non_alphanumeric': 0.11161290322580646, 'fraction_numerical': 0.01096774193548387, 'mean_word_length': 2.1740020470829067, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 14, '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': '2248729', 'n_tokens_mistral': 940, 'n_tokens_neox': 873, 'n_words': 279}