<commit_before>/**
 * Page Info Service
 * Contains information about current page
 */
(function () {
    'use strict';

    angular.module('UIModule').factory('PageInfoService', [
        '$window',
        function ($window) {
            var defaultTitle = 'AIOMedia';

            /**
             * Info about the current page
             * @type {{}}
             */
            var info = {
                icon  : null,
                title : null,
                help  : false,
                config: false
            };

            /**
             * Path to the current
             * @type {Array}
             */
            var path = [];

            var addHomeToPath = true;

            /**
             * Current state
             * @type {{}}
             */
            var current = null;

            /**
             * Previous state
             * @type {{}}
             */
            var previous = null;

            return {
                getInfo: function (key) {
                    var ret = null;

                    if (key) {
                        // Check if requested key exists
                        if (info[key]) {
                            ret = info[key];
                        }
                    } else {
                        // Return all info if no key provided
                        ret = info;
                    }

                    return ret;
                },

                getPath: function () {
                    return path;
                },

                build: function (state, first) {
                    if (first) {
                        // We start rebuilding the path, so empty old
                        while (path.length > 0) {
                            path.pop();
                        }
<commit_msg>fix undefined<commit_after>/**
 * Page Info Service
 * Contains information about current page
 */
(function () {
    'use strict';

    angular.module('UIModule').factory('PageInfoService', [
        '$window',
        function ($window) {
            var defaultTitle = 'AIOMedia';

            /**
             * Info about the current page
             * @type {{}}
             */
            var info = {
                icon  : null,
                title : null,
                help  : false,
                config: false
            };

            /**
             * Path to the current
             * @type {Array}
             */
            var path = [];

            var addHomeToPath = true;

            /**
             * Current state
             * @type {{}}
             */
            var current = null;

            /**
             * Previous state
             * @type {{}}
             */
            var previous = null;

            return {
                getInfo: function (key) {
                    var ret = null;

                    if (key) {
                        // Check if requested key exists
                        if (info[key]) {
                            ret = info[key];
                        }
                    } else {
                        // Return all info if no key provided
                        ret = info;
                    }

                    return ret;
                },

                getPath: function () {
                    return path;
                },

                build: function (state, first) {
                    if (first) {
                        // We start rebuilding the path, so empty old
                        while (path.length > 0) {
                            path.pop();
                        }

                        if (!state.pageInfo) {
                            state.pageInfo = {};
                        }

{'fraction_non_alphanumeric': 0.09192645883293366, 'fraction_numerical': 0.0005329070077271516, 'mean_word_length': 0.6955736224028907, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6189512', 'n_tokens_mistral': 849, 'n_tokens_neox': 773, 'n_words': 224}