<commit_before>//
//  ViewController.swift
//  Spectra-OSXExample
//
//  Created by <NAME> on 12/9/15.
//  Copyright © 2015 Spectra. All rights reserved.
//

import Cocoa
import Spectra
import Fuzi
import Metal

class ViewController: NSViewController {
    
    var device: MTLDevice?
    var library: MTLLibrary?

    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.device = MTLCreateSystemDefaultDevice()
        self.library = device!.newDefaultLibrary()

        // Do any additional setup after loading the view.
        let appBundle = NSBundle(forClass: ViewController.self)
        let xmlData: NSData = S3DXML.readXML(appBundle, filename: "DefaultPipeline")
        let s3d = S3DXML(data: xmlData)

        var descMan = DescriptorManager(library: library!)
        descMan.parseS3DXML(s3d)
    }

    override var representedObject: AnyObject? {
        didSet {<commit_msg>implement MetalNode in example application<commit_after>//
//  ViewController.swift
//  Spectra-OSXExample
//
//  Created by <NAME> on 12/9/15.
//  Copyright © 2015 Spectra. All rights reserved.
//

import Cocoa
import Spectra
import Fuzi
import Metal
import Swinject

class ViewController: NSViewController {
    
    var device: MTLDevice?
    var library: MTLLibrary?

    override func viewDidLoad() {
        super.viewDidLoad()
        
        // TODO: tie device/library to those initialized in containers
        
        self.device = MTLCreateSystemDefaultDevice()
        self.library = device!.newDefaultLibrary()

        // Do any additional setup after loading the view.
        let appBundle = NSBundle(forClass: ViewController.self)
        let xml = MetalParser.readXML(appBundle, filename: "DefaultPipeline", bundleResourceName: nil)!
        
        let metaContainer = MetalParser.initMetalEnums(Container())
        MetalParser.initMetal(metaContainer)
        
        let metalParser = MetalParser(parentContainer: metaContainer)
        metalParser.parseXML(xml)
    }

    override var representedObject: AnyObject? {
        didSet {
{'fraction_non_alphanumeric': 0.0846968238691049, 'fraction_numerical': 0.011068334937439845, 'mean_word_length': 2.766304347826087, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '5930625', 'n_tokens_mistral': 602, 'n_tokens_neox': 573, 'n_words': 159}