<commit_before>//
//  Enum.swift
//  Hakumai
//
//  Created by <NAME> on 11/19/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Foundation

enum RoomPosition: Int, Printable {
    case Arena = 0
    case StandA
    case StandB
    case StandC
    case StandD
    case StandE
    case StandF
    case StandG
    case StandH
    case StandI
    case StandJ
    
    var description: String {
        return "\(self.rawValue)(\(self.label()))"
    }

    // MARK: - Functions
    func previous() -> RoomPosition? {
        if self == .Arena {
            return nil
        }
        
        return RoomPosition(rawValue: self.rawValue - 1)
    }
    
    func next() -> RoomPosition? {
        if self == .StandJ {
            return nil
        }
        
        return RoomPosition(rawValue: self.rawValue + 1)
    }
    
    func label() -> String {
        switch self {
        case .Arena:
            return "アリーナ"
        case .StandA:
            return "立ち見A"
        case .StandB:
            return "立ち見B"
        case .StandC:
            return "立ち見C"
        case .StandD:
            return "立ち見D"
        case .StandE:
            return "立ち見E"
        case .StandF:
            return "立ち見F"
        case .StandG:
            return "立ち見G"
        case .StandH:
            return "立ち見H"
        case .StandI:
            return "立ち見I"
        case .StandJ:
            return "立ち見J"
        }
    }
    
    func shortLabel() -> String {
        switch self {
        case .Arena:
            return "ア"
        case .StandA:
            return "A"
        case .StandB:
            return "B"
        case .StandC:
            return "C"
        case .StandD:
            return "D"
        case .StandE:
            return "E"
        case .StandF:
            return "F"
        case .StandG:
            return "G"
        case .StandH:
            return "H"
        case .StandI:
            return "I"
        case .StandJ:
            return "J"
        }
    }
}
<commit_msg>add workaround for compile-time 'segmentation fault 11' issue<commit_after>//
//  Enum.swift
//  Hakumai
//
//  Created by <NAME> on 11/19/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Foundation

enum RoomPosition: Int, Printable {
    case Arena = 0
    case StandA
    case StandB
    case StandC
    case StandD
    case StandE
    case StandF
    case StandG
    case StandH
    case StandI
    case StandJ
    
    var description: String {
        return "\(self.rawValue)(\(self.label()))"
    }

    // MARK: - Functions
    func previous() -> RoomPosition? {
        if self == .Arena {
            return nil
        }
        
        return RoomPosition(rawValue: self.rawValue - 1)
    }
    
    func next() -> RoomPosition? {
        if self == .StandJ {
            return nil
        }
        
        return RoomPosition(rawValue: self.rawValue + 1)
    }
    
    func label() -> String {
        switch self {
        case .Arena:
            return "アリーナ"
        case .StandA:
            return "立ち見A"
        case .StandB:
            return "立ち見B"
        case .StandC:
            return "立ち見C"
        case .StandD:
            return "立ち見D"
        case .StandE:
            return "立ち見E"
        case .StandF:
            return "立ち見F"
        case .StandG:
            return "立ち見G"
        case .StandH:
            return "立ち見H"
        case .StandI:
            return "立ち見I"
        case .StandJ:
            return "立ち見J"
        }
    }
    
    func shortLabel() -> String {
        // TODO: should replace this if-else clause with switch-clause below.
        // this is damned workaround for complile-time 'segmentation fault 11' issue.
        // http://stackoverflow.com/questions/28696248/segmentation-fault-11-when-building-for-profiling-in-a-swift-enum
        if self == .Arena {
            return "ア"
        }
        else if self == .StandA {
            return "A"
        }
        else if self == .StandB {
            return "B"
        }
        else if self == .StandC {
            return "C"
        }
        else if self == .StandD {
            return "D"
        }
        else if self == .StandE {
            return "E"
        }
        else if self == .StandF {
            return "F"
        }
        else if self == .StandG {
            return "G"
        }
        else if self == .StandH {
            return "H"
        }
        else if self == .StandI {
            return "I"
        }
        else if self == .StandJ {
            return "J"
        }
        
        return "?"

        /*
        switch self {
        case .Arena:
            return "ア"
        case .StandA:
            return "A"
        case .StandB:
            return "B"
        case .StandC:
            return "C"
        case .StandD:
            return "D"
        case .StandE:
            return "E"
        case .StandF:
            return "F"
        case .StandG:
            return "G"
        case .StandH:
            return "H"
        case .StandI:
            return "I"
        case .StandJ:
            return "J"
        }
         */
    }
}

{'fraction_non_alphanumeric': 0.097712291585886, 'fraction_numerical': 0.0077549437766576195, 'mean_word_length': 1.108295872496935, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '2867334', 'n_tokens_mistral': 1607, 'n_tokens_neox': 1557, 'n_words': 439}