<commit_before>//事件绑定函数，兼容浏览器差异
function addEvent(element, event, listener) {
    try {
        element.addEventListener(event, listener, false);
    }
    catch(e){
        try{
            element.attachEvent("on" + event, listener);
        }
        catch(e) {
            element["on" + event] = listener;
        }
    }
    
}

//遍历数组的方法，针对数组中每一个元素执行fn函数，并将数组索引和元素作为参数传递，后面用
function each(arr, fn) {
    for (var cur = 0; cur < arr.length; cur++) {
        fn(arr[cur], cur);
    }
}

//将输入的内容分割为数组
function spiltInput(text) {
    var inputArray = [];
    inputArray = (text).split(/[,，;；、\s\n]+/);
    return inputArray;
}

//对textarea内的内容进行trim，否则当开头结尾有大量空格时会有bug
function trim(str) {
    var regex1 = /^\s*/;
    var regex2 = /\s*$/;
    return (str.replace(regex1, "")).replace(regex2, "");
}

function Queue(container, isDelDiv) {
    this.str = [];
    
    this.leftPush = function(obj) {
        this.str.unshift(obj);
        this.paint();
    };
        
    this.rightPush = function(obj) {
        this.str.push(obj);
        this.paint();
    };<commit_msg>fix bug<commit_after>//事件绑定函数，兼容浏览器差异
function addEvent(element, event, listener) {
    try {
        element.addEventListener(event, listener, false);
    }
    catch(e){
        try{
            element.attachEvent("on" + event, listener);
        }
        catch(e) {
            element["on" + event] = listener;
        }
    }
    
}

//遍历数组的方法，针对数组中每一个元素执行fn函数，并将数组索引和元素作为参数传递，后面用
function each(arr, fn) {
    for (var cur = 0; cur < arr.length; cur++) {
        fn(arr[cur], cur);
    }
}

//将输入的内容分割为数组
function spiltInput(text) {
    var inputArray = [];
    inputArray = (text).split(/[,，;；、\s\n]+/);
    return inputArray;
}

//对textarea内的内容进行trim，否则当开头结尾有大量空格时会有bug
function trim(str) {
    var regex1 = /^\s*/;
    var regex2 = /\s*$/;
    return (str.replace(regex1, "")).replace(regex2, "");
}

function Queue(container, isDelDiv) {
    this.str = [];
    
    this.leftPush = function(obj) {
        if (obj.length) {
            this.str.unshift(obj);
            this.paint();
        }
    };
        
    this.rightPush = function(obj) {
        if (obj.length) {
            this.str.push(obj);
            this.paint();
        }
    };
{'fraction_non_alphanumeric': 0.16457960644007155, 'fraction_numerical': 0.004472271914132379, 'mean_word_length': 2.1330532212885154, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3844897', 'n_tokens_mistral': 886, 'n_tokens_neox': 923, 'n_words': 133}