<commit_before>/**
 * ˽űغ mile1.jarеĹܶjavaɡ
 */

var oShell = new ActiveXObject('WScript.Shell');

(function(ws){
    if (ws.fullName.slice(-12).toLowerCase() !== '\\cscript.exe') {
        var cmd = 'cscript.exe //nologo "' + ws.scriptFullName + '"';
        var args = ws.arguments;
        for (var i = 0, len = args.length; i < len; i++) {
          var arg = args(i);
          cmd += ' ' + (~arg.indexOf(' ') ? '"' + arg + '"' : arg);
        }
        oShell.run(cmd);
        ws.quit();
      }
})(WScript);

var mile1Home = oShell.ExpandEnvironmentStrings('%USERPROFILE%')+'\\.mile1';
var fso = new ActiveXObject('Scripting.FileSystemObject');

function mkdirs(path) {
  if(!fso.FolderExists(path)){
    mkdirs(fso.GetParentFolderName(path));
    fso.CreateFolder(path)
  }
}

mkdirs(mile1Home);
var mile1JarFilePath = mile1Home + '\\mile1.jar';

(function(ws){
    if(!fso.FileExists(mile1JarFilePath)) {
        ws.stdout.writeLine("Installing Mile1..");
        var xHttp = new ActiveXObject("Microsoft.XMLHTTP");
        var bStrm = new ActiveXObject("Adodb.Stream");
        xHttp.Open('GET', 'http://git.oschina.net/43284683/Mile1/raw/master/downloads/mile1.jar', false);
        xHttp.Send();

        bStrm.type = 1; // binary
        bStrm.open();
        bStrm.write(xHttp.responseBody);
        bStrm.savetofile(mile1JarFilePath, 2); // overwrite
    }
    var scriptFilePath = ws.scriptFullName;
    var scriptDirectoryPath = fso.GetParentFolderName(fso.GetFile(scriptFilePath))
    var cmdline = 'cmd /c java -Dmile1.script.path="' + scriptDirectoryPath + '" -jar "' + mile1JarFilePath + '" ' + ws.arguments.join(' ') + ' 2>&1';
    ws.echo(cmdline);
    var javaProcess = oShell.exec(cmdline);
    do{
        ws.stdout.writeLine(javaProcess.stdout.readLine())
    } while (javaProcess.stdout.atEndOfStream)
})(WScript);
<commit_msg>mile1 update for windows<commit_after>/**
 * ˽űغ mile1.jarеĹܶjavaɡ
 */

var oShell = new ActiveXObject('WScript.Shell');

(function(ws){
    if (ws.fullName.slice(-12).toLowerCase() !== '\\cscript.exe') {
        var cmd = 'cscript.exe //nologo "' + ws.scriptFullName + '"';
        var args = ws.arguments;
        for (var i = 0, len = args.length; i < len; i++) {
          var arg = args(i);
          cmd += ' ' + (~arg.indexOf(' ') ? '"' + arg + '"' : arg);
        }
        oShell.run(cmd);
        ws.quit();
      }
})(WScript);

var mile1Home = oShell.ExpandEnvironmentStrings('%USERPROFILE%')+'\\.mile1';
var fso = new ActiveXObject('Scripting.FileSystemObject');

function mkdirs(path) {
  if(!fso.FolderExists(path)){
    mkdirs(fso.GetParentFolderName(path));
    fso.CreateFolder(path)
  }
}

mkdirs(mile1Home);
var mile1JarFilePath = mile1Home + '\\mile1.jar';


(function(ws){
    function download_mile1_jar() {
            var xHttp = new ActiveXObject("Microsoft.XMLHTTP");
            var bStrm = new ActiveXObject("Adodb.Stream");
            xHttp.Open('GET', 'http://git.oschina.net/43284683/Mile1/raw/master/downloads/mile1.jar', false);
            xHttp.Send();

            bStrm.type = 1; // binary
            bStrm.open();
            bStrm.write(xHttp.responseBody);
            bStrm.savetofile(mile1JarFilePath, 2); // overwrite
            bStrm.close();
            ws.stdout.writeLine("Done.")
    }
    if(!fso.FileExists(mile1JarFilePath)) {
        ws.stdout.write("Installing Mile1..");
        download_mile1_jar();
    }
    var scriptFilePath = ws.scriptFullName;
    var scriptDirectoryPath = fso.GetParentFolderName(fso.GetFile(scriptFilePath))
    if(!ws.arguments[0] == 'update'){
        var cmdline = 'cmd /c java -Dmile1.script.path="' + scriptDirectoryPath + '" -jar "' + mile1JarFilePath + '" ' + ws.arguments.join(' ') + ' 2>&1';
        ws.echo(cmdline);
        var javaProcess = oShell.exec(cmdline);
        do{
            ws.stdout.writeLine(javaProcess.stdout.readLine())
        } while (javaProcess.stdout.atEndOfStream)
    } else {
       fso.DeleteFile(mile1JarFilePath);
       ws.stdout.write("Updating Mile1...");
       download_mile1_jar();
    }
})(WScript);

{'fraction_non_alphanumeric': 0.1695205479452055, 'fraction_numerical': 0.015900195694716242, 'mean_word_length': 2.789620018535681, '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': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1281303', 'n_tokens_mistral': 1466, 'n_tokens_neox': 1405, 'n_words': 225}