<commit_before>'use strict';

var util = require('gulp-util');
var PluginError = util.PluginError;
var sane = require('sane');
var glob2base = require('./glob2base');
var glob = require('glob');
var extend = require('extend');
var debounce = require('debounce');
var path = require('path');

var PLUGIN_NAME = 'gulp-sane-watch';

var defaults = {
    debounce: 0,
    onChange: null,
    onAdd: null,
    onDelete: null,
    onReady: null,
    verbose: true,
    saneOptions: {},
    events: [
        'onDelete',
        'onChange',
        'onAdd'
    ]
};

function parseGlob(str) {
    var rs = {};

    if (str.indexOf('/' >= 0) && path.sep === '\\') {
        str = str.replace(new RegExp('/', 'g'), path.sep);
    } else if (str.indexOf('\\') >= 0 && path.sep === '/') {
        str = str
            .replace(new RegExp('\\\\', 'g'), path.sep)
            .replace(new RegExp('//', 'g'), path.sep);
    }

    rs.dir = glob2base(new glob.Glob(str));
    rs.glob = str.replace(rs.dir, '');

    if (/^.\//.test(rs.glob) || /^.\\/.test(rs.glob)) {
        rs.glob = rs.glob.substr(2);
    }

    return rs;
}

function log(message, subMessage) {
    var str = '[' + util.colors.green(PLUGIN_NAME) + '] ' + util.colors.cyan(message);

    if (subMessage) {
        str += ' (' + util.colors.magenta(subMessage) + ')';
    }<commit_msg>Fixed support for Windows globs<commit_after>'use strict';

var util = require('gulp-util');
var PluginError = util.PluginError;
var sane = require('sane');
var glob2base = require('./glob2base');
var glob = require('glob');
var extend = require('extend');
var debounce = require('debounce');
var path = require('path');

var PLUGIN_NAME = 'gulp-sane-watch';

var defaults = {
    debounce: 0,
    onChange: null,
    onAdd: null,
    onDelete: null,
    onReady: null,
    verbose: true,
    saneOptions: {},
    events: [
        'onDelete',
        'onChange',
        'onAdd'
    ]
};

function parseGlob(str) {
    var rs = {};

    if (str.indexOf('/' >= 0) && path.sep === '\\') {
        str = str.replace(new RegExp('/', 'g'), path.sep);
    } else if (str.indexOf('\\') >= 0 && path.sep === '/') {
        str = str
            .replace(new RegExp('\\\\', 'g'), path.sep)
            .replace(new RegExp('//', 'g'), path.sep);
    }

    rs.dir = glob2base(new glob.Glob(str));
    rs.glob = str.replace(rs.dir, '').split(path.sep).join('/');

    if (/^.\//.test(rs.glob) || /^.\\/.test(rs.glob)) {
        rs.glob = rs.glob.substr(2);
    }

    return rs;
}

function log(message, subMessage) {
    var str = '[' + util.colors.green(PLUGIN_NAME) + '] ' + util.colors.cyan(message);

    if (subMessage) {
        str += ' (' + util.colors.magenta(subMessage) + ')';
    }
{'fraction_non_alphanumeric': 0.21218795888399414, 'fraction_numerical': 0.005139500734214391, 'mean_word_length': 2.498074454428755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6219678', 'n_tokens_mistral': 985, 'n_tokens_neox': 957, 'n_words': 203}