<commit_before>/*global ace, define, exports*/
var language = {};
language.setlangmode = function language_setlangmode(input) {
    "use strict";
    var langmap = {
        coldfusion: "markup",
        css       : "css",
        csv       : "csv",
        dustjs    : "html",
        ejs       : "html",
        handlebars: "html",
        html      : "html",
        html_ruby : "html",
        javascript: "javascript",
        json      : "javascript",
        jsp       : "markup",
        jsx       : "javascript",
        less      : "css",
        markup    : "markup",
        php       : "html",
        qml       : "qml",
        scss      : "css",
        swig      : "html",
        text      : "text",
        titanium  : "tss",
        tss       : "tss",
        twig      : "html",
        velocity  : "velocity",
        xhtml     : "markup",
        xml       : "markup"
    };
    if (typeof input !== "string") {
        return "javascript";
    }
    if (input.indexOf("html") > -1) {
        return "html";
    }
    if (langmap[input] === undefined) {
        return "javascript";
    }
    return langmap[input];
};
language.nameproper  = function language_nameproper(input) {
    "use strict";
    var langmap = {
        coldfusion: "ColdFusion",
        dustjs    : "Dust.js",
        ejs       : "EJS Template",
        elm       : "Elm Template",
        handlebars: "Handlebars Template",
        html_ruby : "ERB (Ruby) Template",
        java      : "Java (not supported yet)",
        javascript: "JavaScript",
        jsp       : "JSTL (JSP)",
        jsx       : "React JSX",
        liquid    : "Liquid Template",
        markup    : "markup",
        scss      : "SCSS",
        text      : "Plain Text",
        titanium  : "Titanium Stylesheets",
        tss       : "Titanium Stylesheets",
        twig      : "HTML TWIG Template",
        typescript: "TypeScript (not supported yet)",
        velocity  : "Apache Velocity",
        volt      : "Volt Template"
    };
    if (typeof input !== "string" || langmap[input] === undefined) {
        return input.toUpperCase();
    }
    return langmap[input];
};
// [0] = language value for ace mode [1] = prettydiff language category from [0]
// [2] = pretty formatting for text output to user
language.auto = function language_auto(sample, defaultLang) {
    "use strict";
    var b         = [],
        c         = 0,
        output    = function language_auto_output(langname) {
            if (langname === "unknown") {
                return [
                    defaultLang, language.setlangmode(defaultLang),
                    "unknown"
                ];
            }
            if (langname === "xhtml" || langname === "markup") {
                return ["xml", "html", "XHTML"];
            }
            if (langname === "tss") {
                return ["tss", "tss", "Titanium Stylesheets"];
            }
            return [
                langname, language.setlangmode(langname),
                language.nameproper(langname)
            ];
        },
        cssA      = function language_auto_cssA() {
            if ((/\$[a-zA-Z]/).test(sample) === true || (/\{\s*(\w|\.|\$|#)+\s*\{/).test(sample) === true) {
                return output("scss");
            }
            if ((/@[a-zA-Z]/).test(sample) === true || (/\{\s*(\w|\.|@|#)+\s*\{/).test(sample) === true) {
                return output("less");
            }
            return output("css");
        },
        notmarkup = function language_auto_notmarkup() {
            var d               = 0,
                join            = "",
                flaga           = false,
                flagb           = false,
                javascriptA     = function language_auto_notmarkup_javascriptA() {
                    if (sample.indexOf("(") > -1 || sample.indexOf("=") > -1 || (sample.indexOf(";") > -1 && sample.indexOf("{") > -1)) {
                        if ((/:\s*((number)|(string))/).test(sample) === true && (/((public)|(private))\s+/).test(sample) === true) {
                            return output("typescript");
                        }
                        return output("javascript");
                    }
                    return output("unknown");
                },
                cssOrJavaScript = function language_auto_notmarkup_cssOrJavaScript() {
                    if ((/:\s*((number)|(string))/).test(sample) === true && (/((public)|(private))\s+/).test(sample) === true) {
                        return output("typescript");
                    }
                    if ((/((public)|(private))\s+(((static)?\s+(v|V)oid)|(class)|(final))/).test(sample) === true) {
                        return output("java");
                    }
                    if ((/\sclass\s+\w/).test(sample) === false && (/<[a-zA-Z]/).test(sample) === true && (/<\/[a-zA-Z]/).test(sample) === true && ((/\s?\{%/).test(sample) === true || (/\{(\{|#)(?!(\{|#|\=))/).test(sample) === true)) {
                        return output("twig");
                    }
                    if ((/^\s*(\$|@)/).test(sample) === false && ((/:\s*(\{|\(|\[)/).test(sample) === true || (/(\{|\s|;)render\s*\(\)\s*\{/).test(sample) === true || (/^(\s*return;?\s*\{)/).test(sample) === true) && (/(\};?\s*)$/).test(sample) === true) {
                        return output("javascript");
                    }
                    if ((/\{\{#/).test(sample) === true && (/\{\{\//).test(sample) === true && (/<\w/).test(sample) === true) {
                        return output("handlebars");
                    }
                    if ((/\{\s*(\w|\.|@|#)+\s*\{/).test(sample) === true) {
                        return output("less");
                    }
                    if ((/\$(\w|-)/).test(sample) === true) {
                        return output("scss");<commit_msg>Updating language detection<commit_after>/*global ace, define, exports*/
var language = {};
language.setlangmode = function language_setlangmode(input) {
    "use strict";
    var langmap = {
        coldfusion: "markup",
        css       : "css",
        csv       : "csv",
        dustjs    : "html",
        ejs       : "html",
        handlebars: "html",
        html      : "html",
        html_ruby : "html",
        javascript: "javascript",
        json      : "javascript",
        jsp       : "markup",
        jsx       : "javascript",
        less      : "css",
        markup    : "markup",
        php       : "html",
        qml       : "qml",
        scss      : "css",
        swig      : "html",
        text      : "text",
        titanium  : "tss",
        tss       : "tss",
        twig      : "html",
        velocity  : "velocity",
        xhtml     : "markup",
        xml       : "markup"
    };
    if (typeof input !== "string") {
        return "javascript";
    }
    if (input.indexOf("html") > -1) {
        return "html";
    }
    if (langmap[input] === undefined) {
        return "javascript";
    }
    return langmap[input];
};
language.nameproper  = function language_nameproper(input) {
    "use strict";
    var langmap = {
        coldfusion: "ColdFusion",
        dustjs    : "Dust.js",
        ejs       : "EJS Template",
        elm       : "Elm Template",
        handlebars: "Handlebars Template",
        html_ruby : "ERB (Ruby) Template",
        java      : "Java (not supported yet)",
        javascript: "JavaScript",
        jsp       : "JSTL (JSP)",
        jsx       : "React JSX",
        liquid    : "Liquid Template",
        markup    : "markup",
        scss      : "SCSS",
        text      : "Plain Text",
        titanium  : "Titanium Stylesheets",
        tss       : "Titanium Stylesheets",
        twig      : "HTML TWIG Template",
        typescript: "TypeScript (not supported yet)",
        velocity  : "Apache Velocity",
        volt      : "Volt Template"
    };
    if (typeof input !== "string" || langmap[input] === undefined) {
        return input.toUpperCase();
    }
    return langmap[input];
};
// [0] = language value for ace mode [1] = prettydiff language category from [0]
// [2] = pretty formatting for text output to user
language.auto = function language_auto(sample, defaultLang) {
    "use strict";
    var b         = [],
        c         = 0,
        output    = function language_auto_output(langname) {
            if (langname === "unknown") {
                return [
                    defaultLang, language.setlangmode(defaultLang),
                    "unknown"
                ];
            }
            if (langname === "xhtml" || langname === "markup") {
                return ["xml", "html", "XHTML"];
            }
            if (langname === "tss") {
                return ["tss", "tss", "Titanium Stylesheets"];
            }
            return [
                langname, language.setlangmode(langname),
                language.nameproper(langname)
            ];
        },
        cssA      = function language_auto_cssA() {
            if ((/\$[a-zA-Z]/).test(sample) === true || (/\{\s*(\w|\.|\$|#)+\s*\{/).test(sample) === true) {
                return output("scss");
            }
            if ((/@[a-zA-Z]/).test(sample) === true || (/\{\s*(\w|\.|@|#)+\s*\{/).test(sample) === true) {
                return output("less");
            }
            return output("css");
        },
        notmarkup = function language_auto_notmarkup() {
            var d               = 0,
                join            = "",
                flaga           = false,
                flagb           = false,
                javascriptA     = function language_auto_notmarkup_javascriptA() {
                    if (sample.indexOf("(") > -1 || sample.indexOf("=") > -1 || (sample.indexOf(";") > -1 && sample.indexOf("{") > -1)) {
                        if ((/:\s*((number)|(string))/).test(sample) === true && (/((public)|(private))\s+/).test(sample) === true) {
                            return output("typescript");
                        }
                        return output("javascript");
                    }
                    return output("unknown");
                },
                cssOrJavaScript = function language_auto_notmarkup_cssOrJavaScript() {
                    if ((/:\s*((number)|(string))/).test(sample) === true && (/((public)|(private))\s+/).test(sample) === true) {
                        return output("typescript");
                    }
                    if ((/((public)|(private))\s+(((static)?\s+(v|V)oid)|(class)|(final))/).test(sample) === true) {
                        return output("java");
                    }
                    if ((/\sclass\s+\w/).test(sample) === false && (/<[a-zA-Z]/).test(sample) === true && (/<\/[a-zA-Z]/).test(sample) === true && ((/\s?\{%/).test(sample) === true || (/\{(\{|#)(?!(\{|#|\=))/).test(sample) === true)) {
                        return output("twig");
                    }
                    if ((/^\s*(\$|@)/).test(sample) === false && (/(\};?\s*)$/).test(sample) === true) {
                        if ((/export\s+default\s+\{/).test(sample) === true || (/:\s*(\{|\(|\[)/).test(sample) === true || (/(\{|\s|;)render\s*\(\)\s*\{/).test(sample) === true || (/^(\s*return;?\s*\{)/).test(sample) === true) {
                            return output("javascript");
                        }
                    }
                    if ((/\{\{#/).test(sample) === true && (/\{\{\//).test(sample) === true && (/<\w/).test(sample) === true) {
                        return output("handlebars");
                    }
                    if ((/\{\s*(\w|\.|@|#)+\s*\{/).test(sample) === true) {
                        return output("less");
                    }
                    if ((/\$(\w|-)/).test(sample) === true) {
                        return output("scss");
{'fraction_non_alphanumeric': 0.189269117025771, 'fraction_numerical': 0.0018588931136459654, 'mean_word_length': 1.3810098571715952, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '6837754', 'n_tokens_mistral': 3568, 'n_tokens_neox': 3345, 'n_words': 670}