<commit_before>'use strict';
var debug = require('debug')('revvedfinder');
var path = require('path');

// Allow to find, on disk, the revved version of a furnished file
//
// +locator+ : this is either:
//    - a hash mapping files with their revved versions
//    - a function that will return a list of file matching a given pattern (for example grunt.file.expand)
//
var RevvedFinder = module.exports = function (locator) {
  if (typeof(locator) === 'function') {
    debug('using function locator');
    this.expandfn = locator;
  } else {
    debug('using file locator %s', locator);
    this.mapping = locator;
  }
};

var regexpQuote = function (str) {
  return (str + '').replace(/([.?*+\^$\[\]\\(){}|\-])/g, '\\$1');
};

RevvedFinder.prototype.getCandidatesFromMapping = function(file, searchPaths) {
  var dirname = path.dirname(file);
  var candidates = [];
  var self = this;

  searchPaths.forEach(function(sp) {
    var key = path.normalize(path.join(sp, file));
    debug('Looking at mapping for %s (from %s/%s)',key, sp, file);
<commit_msg>Fixes getCandidatesFromMapping on windows<commit_after>'use strict';
var debug = require('debug')('revvedfinder');
var path = require('path');

// Allow to find, on disk, the revved version of a furnished file
//
// +locator+ : this is either:
//    - a hash mapping files with their revved versions
//    - a function that will return a list of file matching a given pattern (for example grunt.file.expand)
//
var RevvedFinder = module.exports = function (locator) {
  if (typeof(locator) === 'function') {
    debug('using function locator');
    this.expandfn = locator;
  } else {
    debug('using file locator %s', locator);
    this.mapping = locator;
  }
};

var regexpQuote = function (str) {
  return (str + '').replace(/([.?*+\^$\[\]\\(){}|\-])/g, '\\$1');
};

RevvedFinder.prototype.getCandidatesFromMapping = function(file, searchPaths) {
  var dirname = path.dirname(file);
  var candidates = [];
  var self = this;

  searchPaths.forEach(function(sp) {
    var key = path.normalize(path.join(sp, file)).replace(/\\/g, '/');
    debug('Looking at mapping for %s (from %s/%s)',key, sp, file);

{'fraction_non_alphanumeric': 0.16975023126734506, 'fraction_numerical': 0.0009250693802035153, 'mean_word_length': 3.6919739696312366, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5730861', 'n_tokens_mistral': 696, 'n_tokens_neox': 688, 'n_words': 207}