<commit_before>'use strict';

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

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

/**
 * Initialize a new sequences container.
 *
 * @param {danf:manipulation.flowDriver} The flow driver.
 * @param {danf:dependencyInjection.provider<danf:manipulation:sequence>} sequenceProvider The sequence provider.
 */
function SequencesContainer(flowDriver, sequenceProvider) {
    this._definitions = {};
    this._context = {};
    this._sequenceInterpreters = [];
    this._handledParameters = {};

    if (flowDriver) {
        this.flowDriver = flowDriver;
    }
    if (sequenceProvider) {
        this.sequenceProvider = sequenceProvider;
    }

    resetSequences.call(this);
}

SequencesContainer.defineImplementedInterfaces(['danf:event.sequencesContainer', 'danf:manipulation.registryObserver']);

SequencesContainer.defineDependency('_sequenceInterpreters', 'danf:event.sequenceInterpreter_array');
SequencesContainer.defineDependency('_flowDriver', 'danf:manipulation.flowDriver');
SequencesContainer.defineDependency('_sequenceProvider', 'danf:dependencyInjection.provider', 'danf:event.sequence');

/**
 * Set the flow driver.
 *
 * @param {danf:manipulation.flowDriver} flowDriver The flow driver.
 * @api public
 */
Object.defineProperty(SequencesContainer.prototype, 'flowDriver', {
    set: function(flowDriver) { this._flowDriver = flowDriver; }
});

/**
 * Set the sequence provider.
 *
 * @param {danf:dependencyInjection.provider<danf:manipulation:sequence>} The sequence provider.
 * @api public
 */
Object.defineProperty(SequencesContainer.prototype, 'sequenceProvider', {
    set: function(sequenceProvider) { this._sequenceProvider = sequenceProvider; }
});

/**
 * @interface {danf:event.sequencesContainer}
 */
Object.defineProperty(SequencesContainer.prototype, 'handledParameters', {
    get: function() { return this._handledParameters }
});

/**
 * Add a sequence interpreter.
 *
 * @param {danf:event.sequenceInterpreter} sequenceInterpreter The sequence interpreter.
 * @api public
 */
SequencesContainer.prototype.addSequenceInterpreter = function(sequenceInterpreter) {
    Object.checkType(sequenceInterpreter, 'danf:event.sequenceInterpreter');

    var added = false,
        order = sequenceInterpreter.order
    ;

    // Register handled parameters.
    this._handledParameters = utils.merge(this._handledParameters, sequenceInterpreter.contract);

    // Register sequence interpreters.
    if (null != order) {<commit_msg>Fix comments<commit_after>'use strict';

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

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

/**
 * Initialize a new sequences container.
 *
 * @param {danf:manipulation.flowDriver} flowDriver The flow driver.
 * @param {danf:dependencyInjection.provider<danf:manipulation.sequence>} sequenceProvider The sequence provider.
 */
function SequencesContainer(flowDriver, sequenceProvider) {
    this._definitions = {};
    this._context = {};
    this._sequenceInterpreters = [];
    this._handledParameters = {};

    if (flowDriver) {
        this.flowDriver = flowDriver;
    }
    if (sequenceProvider) {
        this.sequenceProvider = sequenceProvider;
    }

    resetSequences.call(this);
}

SequencesContainer.defineImplementedInterfaces(['danf:event.sequencesContainer', 'danf:manipulation.registryObserver']);

SequencesContainer.defineDependency('_sequenceInterpreters', 'danf:event.sequenceInterpreter_array');
SequencesContainer.defineDependency('_flowDriver', 'danf:manipulation.flowDriver');
SequencesContainer.defineDependency('_sequenceProvider', 'danf:dependencyInjection.provider', 'danf:event.sequence');

/**
 * Set the flow driver.
 *
 * @param {danf:manipulation.flowDriver} flowDriver The flow driver.
 * @api public
 */
Object.defineProperty(SequencesContainer.prototype, 'flowDriver', {
    set: function(flowDriver) { this._flowDriver = flowDriver; }
});

/**
 * Set the sequence provider.
 *
 * @param {danf:dependencyInjection.provider<danf:manipulation.sequence>} The sequence provider.
 * @api public
 */
Object.defineProperty(SequencesContainer.prototype, 'sequenceProvider', {
    set: function(sequenceProvider) { this._sequenceProvider = sequenceProvider; }
});

/**
 * @interface {danf:event.sequencesContainer}
 */
Object.defineProperty(SequencesContainer.prototype, 'handledParameters', {
    get: function() { return this._handledParameters }
});

/**
 * Add a sequence interpreter.
 *
 * @param {danf:event.sequenceInterpreter} sequenceInterpreter The sequence interpreter.
 * @api public
 */
SequencesContainer.prototype.addSequenceInterpreter = function(sequenceInterpreter) {
    Object.checkType(sequenceInterpreter, 'danf:event.sequenceInterpreter');

    var added = false,
        order = sequenceInterpreter.order
    ;

    // Register handled parameters.
    this._handledParameters = utils.merge(this._handledParameters, sequenceInterpreter.contract);

    // Register sequence interpreters.
    if (null != order) {
{'fraction_non_alphanumeric': 0.12421630094043887, 'fraction_numerical': 0.0, 'mean_word_length': 5.070154577883472, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2751374', 'n_tokens_mistral': 1412, 'n_tokens_neox': 1407, 'n_words': 258}