<commit_before>/*
 @author <NAME>
 @component KabSearch
 */

screens.kab.search = function KabSearch(me) {
    me.init = function () {
        me.terms = {};
    };
    me.clear = function () {
        me.terms = {};
    };
    me.setTerm = function (options, styles, item, source, translation, explanation, used = true) {
        if (!("search" in item) || item.search === true) {
            if (!source) {
                source = item.source ? item.source : item.term;
            }
            if (!translation && options.doTranslation) {
                translation = item.translation;
            }
            if (!explanation && options.doExplanation) {
                explanation = item.explanation;
            }
            if (item.includePrefix) {
                translation = item.prefix + " " + translation;
            }
            var term = source;
            if (explanation && translation) {
                if (options.prioritizeExplanation) {
                    term = explanation + " (" + translation + ")";
                } else {
                    term = translation + " (" + explanation + ")";
                }
            } else if (explanation) {
                term = explanation;
            } else if (translation) {
                term = translation;
            }
            var searchTerm = me.terms[item.term];
            if (!searchTerm) {
                searchTerm = me.terms[item.term] = { count: 0 };
            }
            searchTerm.count++;
            searchTerm.term = item.term;
            if(used || !searchTerm.used) {
                searchTerm.used = used;
            }
            if (item.label) {
                searchTerm.source = item.label;
            } else {
                searchTerm.source = source;
            }
            searchTerm.source = me.core.string.unparseWords(searchTerm.source);
            if (item.style) {
                var style = item.style;
                if (typeof style === "string" && styles) {
                    style = styles[style];
                }
                searchTerm.heading = style.heading;
                searchTerm.phase = style.phase;
                searchTerm.tooltip = style.tooltip;
            }
            else {
                searchTerm.heading = null;
                searchTerm.phase = null;
                searchTerm.tooltip = null;
            }
        }
    };

};<commit_msg>bug fix<commit_after>/*
 @author <NAME>
 @component KabSearch
 */

screens.kab.search = function KabSearch(me) {
    me.init = function () {
        me.terms = {};
    };
    me.clear = function () {
        me.terms = {};
    };
    me.setTerm = function (options, styles, item, source, translation, explanation, used = true) {
        if (!("search" in item) || item.search === true) {
            if (!source) {
                source = item.source ? item.source : item.term;
            }
            if (!translation && options.doTranslation) {
                translation = item.translation;
            }
            if (!explanation && options.doExplanation) {
                explanation = item.explanation;
            }
            if (item.includePrefix) {
                translation = item.prefix + " " + translation;
            }
            var term = source;
            if (explanation && translation) {
                if (options.prioritizeExplanation) {
                    term = explanation + " (" + translation + ")";
                } else {
                    term = translation + " (" + explanation + ")";
                }
            } else if (explanation) {
                term = explanation;
            } else if (translation) {
                term = translation;
            }
            var searchTerm = me.terms[source];
            if (!searchTerm) {
                searchTerm = me.terms[source] = { count: 0 };
            }
            searchTerm.count++;
            searchTerm.term = item.term;
            if(used || !searchTerm.used) {
                searchTerm.used = used;
            }
            if (item.label) {
                searchTerm.source = item.label;
            } else {
                searchTerm.source = source;
            }
            searchTerm.source = me.core.string.unparseWords(searchTerm.source);
            if (item.style) {
                var style = item.style;
                if (typeof style === "string" && styles) {
                    style = styles[style];
                }
                searchTerm.heading = style.heading;
                searchTerm.phase = style.phase;
                searchTerm.tooltip = style.tooltip;
            }
            else {
                searchTerm.heading = null;
                searchTerm.phase = null;
                searchTerm.tooltip = null;
            }
        }
    };

};
{'fraction_non_alphanumeric': 0.11373035566583954, 'fraction_numerical': 0.00041356492969396195, 'mean_word_length': 1.2188073394495413, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4645929', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1175, 'n_words': 253}