<commit_before>ngapp.service('settingsService', function() {
    var service = this;
    var defaultSettings = {
        'cacheErrors': true,
        'theme': 'Vanilla'
    };

    this.loadSettings = function(profileName) {
        service.currentProfile = profileName;
        service.profilePath = `app/profiles/${profileName}`;
        service.settingsPath = `${service.profilePath}/settings.json`;
        service.settings = fileHelpers.loadJsonFile(service.settingsPath, defaultSettings);
    };

    this.saveSettings = function() {
        fileHelpers.saveJsonFile(service.settingsPath, service.settings);
    };
});<commit_msg>updated settings service for dynamic tabs and defaults<commit_after>ngapp.service('settingsService', function() {
    let service = this,
        tabs = [{
            label: 'Core',
            templateUrl: 'partials/settings/core.html',
            defaultSettings: { theme: 'Vanilla' }
        }];

    this.buildSettings = function(settings) {
        let defaults = {};
        tabs.forEach((tab) => Object.deepAssign(defaults, tab.defaultSettings));
        service.settings = Object.deepAssign(defaults, settings);
    };

    this.loadSettings = function(profileName) {
        service.currentProfile = profileName;
        service.profilePath = `app/profiles/${profileName}`;
        service.settingsPath = `${service.profilePath}/settings.json`;
        let settings = fileHelpers.loadJsonFile(service.settingsPath, {});
        service.buildSettings(settings);
    };

    this.saveSettings = function() {
        fileHelpers.saveJsonFile(service.settingsPath, service.settings);
    };

    this.registerSettings = function(settingsTab) {
        tabs.push(settingsTab);
    };

    this.getTabs = function() {
        return tabs;
    }
});
{'fraction_non_alphanumeric': 0.12744550027948576, 'fraction_numerical': 0.0, 'mean_word_length': 3.004474272930649, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2224669', 'n_tokens_mistral': 483, 'n_tokens_neox': 479, 'n_words': 79}