<commit_before>//
//  Player.swift
//  SwiftGoal
//
//  Created by <NAME> on 02/06/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import Foundation
import Argo
import Runes

struct Player {
    let identifier: String
    let name: String
}

// MARK: Equatable

func ==(lhs: Player, rhs: Player) -> Bool {
    return lhs.identifier == rhs.identifier
}

// MARK: Decodable

extension Player: Decodable {
    static func create(identifier: String)(name: String) -> Player {
        return Player(identifier: identifier, name: name)
    }

    static func decode(json: JSON) -> Decoded<Player> {
        return Player.create
            <^> json <| "id"
            <*> json <| "name"
    }
}

// MARK: Hashable

extension Player: Hashable {
    var hashValue: Int {
        return identifier.hashValue
    }
}
<commit_msg>Add rating property to Player model<commit_after>//
//  Player.swift
//  SwiftGoal
//
//  Created by <NAME> on 02/06/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import Foundation
import Argo
import Runes

struct Player {
    let identifier: String
    let name: String
    let rating: Float
}

// MARK: Equatable

func ==(lhs: Player, rhs: Player) -> Bool {
    return lhs.identifier == rhs.identifier
}

// MARK: Decodable

extension Player: Decodable {
    static func create(identifier: String)(name: String)(rating: Float) -> Player {
        return Player(identifier: identifier, name: name, rating: rating)
    }

    static func decode(json: JSON) -> Decoded<Player> {
        return Player.create
            <^> json <| "id"
            <*> json <| "name"
            <*> json <| "rating"
    }
}

// MARK: Hashable

extension Player: Hashable {
    var hashValue: Int {
        return identifier.hashValue
    }
}

{'fraction_non_alphanumeric': 0.12697516930022573, 'fraction_numerical': 0.011286681715575621, 'mean_word_length': 2.4901574803149606, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 20, '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': '2948207', 'n_tokens_mistral': 576, 'n_tokens_neox': 545, 'n_words': 167}