<commit_before>const pathToRegexp = require( "path-to-regexp" )
const series = require( "async/series" )

class Params {
	constructor( outRegx, names ) {
		for ( let indexName in names ) {
			let name = names[ indexName ]
			if ( typeof name === 'string' ) {
				this[ name ] = outRegx[ ( Number( indexName ) + 1 ) ]
			}
		}
	}
}

/**
 * Name associated with associated paths in the Path class Exec.
 * 
 * @type {Symbol}
 */
const pathNameSymbol = Symbol( 'paths' )

class PathExec {
	constructor() {
		this[ pathNameSymbol ] = new Set()
	}

	/**
	 * Define un uso para el path definido.
	 * 
	 * @param  {String|RegExp} path     Path used to find and run the executions
	 *                                  defined.
	 * @param  {Array}         [keys]   Keywords to rename the parameters found.
	 * @param  {Function}      [exec]   Execution load to find matches in
	 *                                  `Path.exec()`.
	 */
	use( path, keys = [], exec = null ) {
		if ( exec == null ) {
			return this.exec( path )
		} else {
			this[ pathNameSymbol ].add( {
				'regexp': pathToRegexp( path, keys ),
				exec,
			} )
		}
	}

	* filter( pathToEvaluation ) {
		let collectionOut = new Set
		this[ pathNameSymbol ].forEach( function( pathEvaluation ) {
			let resEvaluation
			if ( resEvaluation = pathEvaluation.regexp.exec( pathToEvaluation ) ) {
				collectionOut.add( {
					evaluation: new Params( resEvaluation, pathEvaluation.regexp.keys ),
					exec: pathEvaluation.exec
				} )
			}
		} )
		yield * collectionOut
	}

	/**
	 * Find the rules associated to execute defined Executions.
	 * 
	 * @param  {String} path
	 * @return {Promise}
	 */
	exec( path ) {
		return new Promise( ( resolve, reject ) => {
			let clt = this.filter( path )
			let tasks = new Set()

			while ( true ) {
				let c = clt.next()
<commit_msg>add description<commit_after>const pathToRegexp = require( "path-to-regexp" )
const series = require( "async/series" )

class Params {
	constructor( outRegx, names ) {
		for ( let indexName in names ) {
			let name = names[ indexName ]
			if ( typeof name === 'string' ) {
				this[ name ] = outRegx[ ( Number( indexName ) + 1 ) ]
			}
		}
	}
}

/**
 * Name associated with associated paths in the Path class Exec.
 * 
 * @type {Symbol}
 */
const pathNameSymbol = Symbol( 'paths' )

class PathExec {
	constructor() {
		this[ pathNameSymbol ] = new Set()
	}

	/**
	 * Define un uso para el path definido.
	 * 
	 * @param  {String|RegExp} path     Path used to find and run the executions
	 *                                  defined.
	 * @param  {Array}         [keys]   Keywords to rename the parameters found.
	 * @param  {Function}      [exec]   Execution load to find matches in
	 *                                  `Path.exec()`.
	 */
	use( path, keys = [], exec = null ) {
		if ( exec == null ) {
			return this.exec( path )
		} else {
			this[ pathNameSymbol ].add( {
				'regexp': pathToRegexp( path, keys ),
				exec,
			} )
		}
	}

	/**
	 * Filter paths with executions defined
	 *
	 * @param {String} pathToEvaluation Value is evaluatio if is ready to executed.
	 */
	* filter( pathToEvaluation ) {
		let collectionOut = new Set
		this[ pathNameSymbol ].forEach( function( pathEvaluation ) {
			let resEvaluation
			if ( resEvaluation = pathEvaluation.regexp.exec( pathToEvaluation ) ) {
				collectionOut.add( {
					evaluation: new Params( resEvaluation, pathEvaluation.regexp.keys ),
					exec: pathEvaluation.exec
				} )
			}
		} )
		yield * collectionOut
	}

	/**
	 * Find the rules associated to execute defined Executions.
	 * 
	 * @param  {String} path
	 * @return {Promise}
	 */
	exec( path ) {
		return new Promise( ( resolve, reject ) => {
			let clt = this.filter( path )
			let tasks = new Set()

			while ( true ) {
				let c = clt.next()

{'fraction_non_alphanumeric': 0.12242744063324539, 'fraction_numerical': 0.0005277044854881266, 'mean_word_length': 2.4061096136567834, 'pattern_counts': {'":': 0, '<': 3, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7597750', 'n_tokens_mistral': 1372, 'n_tokens_neox': 1174, 'n_words': 363}