<commit_before>'use strict';

/**
 * Expose `Input`.
 */
module.exports = Input;

/**
 * Module dependencies.
 */
var utils = require('../../utils'),
    Abstract = require('./abstract')
;

/**
 * Initialize a new input sequence interpreter.
 *
 * @param {danf:dependencyInjection.sequencesContainer} The sequences container.
 * @param {danf:manipulation.dataResolver} The data resolver.
 */
function Input(sequencesContainer, dataResolver) {
    Abstract.call(this, sequencesContainer);

    this._order = 800;
    if (dataResolver) {
        this.dataResolver = dataResolver;
    }
}

utils.extend(Abstract, Input);

/**
 * Set the data resolver.
 *
 * @param {danf:manipulation.dataResolver} The data resolver.
 * @api public
 */
Object.defineProperty(Input.prototype, 'dataResolver', {
    set: function(dataResolver) {
        this._dataResolver = dataResolver
    }
});

/**
 * @interface {danf:event.sequenceInterpreter}
 */
Object.defineProperty(Input.prototype, 'contract', {
    value: {
        input: {
            type: 'mixed_object'
        }
    }
});

/**
 * @interface {danf:event.sequenceInterpreter}
 */
 Input.prototype.interpret = function(interpretation, definition, context) {
    if (definition.input) {
        interpretation.unshift({
            order: null,
            operations: [interpretInput.call(this, definition.input, definition.id, definition)]
        });
    }

    return interpretation;
}

/**
 * Interpret an input
 *
 * @param {object} input The definition of the input.
 * @param {string} id The identifier of the sequence.
 * @param {mixed_object} defintion The definition of the sequence.
 * @return {function} The interpreted input.
 */
var interpretInput = function(input, id, definition) {
    var self = this;

    return function(flow, callback) {
        definition.input = self._dataResolver.resolve(
            flow.stream,
            input,
            'sequence[{0}]'.format(id)
        );
<commit_msg>Change input source to current stream<commit_after>'use strict';

/**
 * Expose `Input`.
 */
module.exports = Input;

/**
 * Module dependencies.
 */
var utils = require('../../utils'),
    Abstract = require('./abstract')
;

/**
 * Initialize a new input sequence interpreter.
 *
 * @param {danf:dependencyInjection.sequencesContainer} The sequences container.
 * @param {danf:manipulation.dataResolver} The data resolver.
 */
function Input(sequencesContainer, dataResolver) {
    Abstract.call(this, sequencesContainer);

    this._order = 800;
    if (dataResolver) {
        this.dataResolver = dataResolver;
    }
}

utils.extend(Abstract, Input);

/**
 * Set the data resolver.
 *
 * @param {danf:manipulation.dataResolver} The data resolver.
 * @api public
 */
Object.defineProperty(Input.prototype, 'dataResolver', {
    set: function(dataResolver) {
        this._dataResolver = dataResolver
    }
});

/**
 * @interface {danf:event.sequenceInterpreter}
 */
Object.defineProperty(Input.prototype, 'contract', {
    value: {
        input: {
            type: 'mixed_object'
        }
    }
});

/**
 * @interface {danf:event.sequenceInterpreter}
 */
 Input.prototype.interpret = function(interpretation, definition, context) {
    if (definition.input) {
        interpretation.unshift({
            order: null,
            operations: [interpretInput.call(this, definition.input, definition.id, definition)]
        });
    }

    return interpretation;
}

/**
 * Interpret an input
 *
 * @param {object} input The definition of the input.
 * @param {string} id The identifier of the sequence.
 * @param {mixed_object} defintion The definition of the sequence.
 * @return {function} The interpreted input.
 */
var interpretInput = function(input, id, definition) {
    var self = this;

    return function(flow, callback) {
        definition.input = self._dataResolver.resolve(
            flow.currentStream,
            input,
            'sequence[{0}]'.format(id)
        );

{'fraction_non_alphanumeric': 0.13198482932996208, 'fraction_numerical': 0.00202275600505689, 'mean_word_length': 3.036734693877551, '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': '2758587', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1112, 'n_words': 271}