<commit_before>//
//  AppDelegate.swift
//  Hymnal
//
//  Created by <NAME> on 4/30/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

// MARK: - AppDelegate: UIResponder, UIApplicationDelegate

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    // MARK: Properties
    
    var window: UIWindow?
    let stack = CoreDataStack(modelName: "Model")!
    var isDark: Bool!
    var hymnFontSize: CGFloat!

    // MARK: UIApplicationDelegate
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        
        do {
            try stack.dropAllData()
        } catch {
            print("Error droping all objects in DB")
        }
        
        return true
    }
    
    func applicationWillResignActive(_ application: UIApplication) {
        saveState()
    }
    
    func applicationDidEnterBackground(_ application: UIApplication) {
        saveState()
    }
    
    func saveState() {
        stack.save()
    }
}
<commit_msg>Don't nuke db on load<commit_after>//
//  AppDelegate.swift
//  Hymnal
//
//  Created by <NAME> on 4/30/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

// MARK: - AppDelegate: UIResponder, UIApplicationDelegate

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    // MARK: Properties
    
    var window: UIWindow?
    let stack = CoreDataStack(modelName: "Model")!
    var isDark: Bool!
    var hymnFontSize: CGFloat!

    // MARK: UIApplicationDelegate
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        
//        do {
//            try stack.dropAllData()
//        } catch {
//            print("Error dropping all objects in DB")
//        }
        
        return true
    }
    
    func applicationWillResignActive(_ application: UIApplication) {
        saveState()
    }
    
    func applicationDidEnterBackground(_ application: UIApplication) {
        saveState()
    }
    
    func saveState() {
        stack.save()
    }
}

{'fraction_non_alphanumeric': 0.09940448923499771, 'fraction_numerical': 0.008245533669262483, 'mean_word_length': 2.324200913242009, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '6476889', 'n_tokens_mistral': 654, 'n_tokens_neox': 614, 'n_words': 158}