<commit_before>//
//  CalculatorUtils.swift
//  StupidCalculator
//
//  Created by <NAME> on 9/4/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation

// The Enum that contains the various states the calculator can be in
enum CalculatorState: String {
    case FIRST_NUM_ENTRY = "FIRST_NUM_ENTRY"
    
    case OPERATOR_ENTRY = "OPERATOR_ENTRY"
    
    case SECOND_NUM_ENTRY = "SECOND_NUM_ENTRY"
    
    case CALCULATE_RESULT = "CALCULATE_RESULT"
}

// The Enum which stores the four possible operations in the calculator
enum Operator: String {
    case ADDITION = "ADDITION"
    case SUBTRACTION = "SUBTRACTION"
    case MULTIPLICATION = "MULTIPLICATION"
    case DIVISION = "DIVISION"
    case NOTHING = ""
}

// A dictionary that maps the tags of the operator buttons to their respective Operator Enum values
let TAG_TO_OPERATOR_DICT: [Int: Operator] = [
    10: Operator.ADDITION,
    11: Operator.SUBTRACTION,
    12: Operator.MULTIPLICATION,
    13: Operator.DIVISION
]

let OPERATOR_TO_STRING_DICT: [Operator: String] = [
    Operator.ADDITION: "+",
    Operator.SUBTRACTION: "-",
    Operator.MULTIPLICATION: "*",
    Operator.DIVISION: "/",
    Operator.NOTHING: ""<commit_msg>Refactoring code where enum values are used in Dictionaries<commit_after>//
//  CalculatorUtils.swift
//  StupidCalculator
//
//  Created by <NAME> on 9/4/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation

// The Enum that contains the various states the calculator can be in
enum CalculatorState: String {
    case FIRST_NUM_ENTRY = "FIRST_NUM_ENTRY"
    
    case OPERATOR_ENTRY = "OPERATOR_ENTRY"
    
    case SECOND_NUM_ENTRY = "SECOND_NUM_ENTRY"
    
    case CALCULATE_RESULT = "CALCULATE_RESULT"
}

// The Enum which stores the four possible operations in the calculator
enum Operator: String {
    case ADDITION = "ADDITION"
    case SUBTRACTION = "SUBTRACTION"
    case MULTIPLICATION = "MULTIPLICATION"
    case DIVISION = "DIVISION"
    case NOTHING = ""
}

// A dictionary that maps the tags of the operator buttons to their respective Operator Enum values
let TAG_TO_OPERATOR_DICT: [Int: Operator] = [
    10: .ADDITION,
    11: .SUBTRACTION,
    12: .MULTIPLICATION,
    13: .DIVISION
]

let OPERATOR_TO_STRING_DICT: [Operator: String] = [
    .ADDITION: "+",
    .SUBTRACTION: "-",
    .MULTIPLICATION: "*",
    .DIVISION: "/",
    .NOTHING: ""
{'fraction_non_alphanumeric': 0.09924937447873228, 'fraction_numerical': 0.013344453711426188, 'mean_word_length': 3.3070017953321362, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4923416', 'n_tokens_mistral': 841, 'n_tokens_neox': 768, 'n_words': 226}