<commit_before>//
//  FileReference.swift
//  xcconfig-extractor
//
//  Created by <NAME> on 2017/04/30.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import Foundation

public enum FileType: String {
    case xcconfig = "text.xcconfig"
}

public struct FileReference: IsaObject {
    public let key: String
    public let rawObject: [String : Any]
    public let lastKnownFileType: FileType
    public let path: String
    public let sourceTree: String

    // custom property
    public let fullPath: String

    public init?(key: String, value o: [String : Any], objects: [String : Any]) {
        guard IsaType(object: o) == .PBXFileReference else {
            return nil
        }
        self.key = key
        self.rawObject = o
        self.lastKnownFileType = FileType(rawValue: o["lastKnownFileType"] as! String)!
        self.path = o["path"] as! String
        let fullPath = findPaths(to: key, objects: objects) + [self.path]
        self.fullPath = fullPath.joined(separator: "/")
        self.sourceTree = o["sourceTree"] as! String
        guard isa == .PBXFileReference else {
            return nil
        }
    }
    public init?(from id: Any?, objects: [String: Any]) {
        guard let key = id as? String else {
            return nil
        }
        guard let o = objects[key] as? [String: Any] else {
            return nil
        }
        self.init(key: key, value: o, objects: objects)
    }
}<commit_msg>cleanup<commit_after>//
//  FileReference.swift
//  xcconfig-extractor
//
//  Created by <NAME> on 2017/04/30.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import Foundation

public enum FileType: String {
    case xcconfig = "text.xcconfig"
}

public struct FileReference: IsaObject {
    public let key: String
    public let rawObject: [String : Any]
    public let lastKnownFileType: FileType
    public let path: String
    public let sourceTree: String

    // custom property
    public let fullPath: String

    public init?(key: String, value o: [String : Any], objects: [String : Any]) {
        guard IsaType(object: o) == .PBXFileReference else {
            return nil
        }
        self.key = key
        self.rawObject = o
        self.lastKnownFileType = FileType(rawValue: o["lastKnownFileType"] as! String)!
        self.path = o["path"] as! String
        let fullPath = findPaths(to: key, objects: objects) + [self.path]
        self.fullPath = fullPath.joined(separator: "/")
        self.sourceTree = o["sourceTree"] as! String
    }
    public init?(from id: Any?, objects: [String: Any]) {
        guard let key = id as? String else {
            return nil
        }
        guard let o = objects[key] as? [String: Any] else {
            return nil
        }
        self.init(key: key, value: o, objects: objects)
    }
}
{'fraction_non_alphanumeric': 0.11221945137157108, 'fraction_numerical': 0.008550053437833986, 'mean_word_length': 2.2996474735605172, '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': '5881487', 'n_tokens_mistral': 859, 'n_tokens_neox': 827, 'n_words': 266}