<commit_before>#!/usr/bin/env node

'use strict';

var limit = 10;
if (2 < process.argv.length) {
    limit = parseFloat(process.argv[2]);
}
console.log('limit = ' + limit);

var Iterator = require('./Iterator.js');

var anIterator = new Iterator();

console.log('Cur: ' + anIterator.cur);
for (var i = limit; 0 < i--;) {
    console.log('Next: ' + anIterator.next());
    console.log('Cur: ' + anIterator.cur);
}<commit_msg>Test all three iterators.<commit_after>#!/usr/bin/env node

'use strict';

var limit = 10;
if (2 < process.argv.length) {
    limit = parseFloat(process.argv[2]);
}
console.log('limit = \n' + limit);

var Iterator = require('./Iterator.js');
var StepIterator = require('./StepIterator.js');
var RandomIterator = require('./RandomIterator.js');

var anIterator = new Iterator();

console.log('\nBase Iterator:\n');
console.log('Cur: ' + anIterator.cur);
for (var i = limit; 0 < i--;) {
    console.log('Next: ' + anIterator.next());
    console.log('Cur: ' + anIterator.cur);
}

anIterator = new StepIterator({
    step: 5
});

console.log('\nStep Iterator:\n');
console.log('Cur: ' + anIterator.cur);
for (var i = limit; 0 < i--;) {
    if (i === Math.floor(limit / 2)) {
        console.log('\nStep: ' + anIterator.step);
        anIterator.step = 2;
        console.log('New Step: ' + anIterator.step + '\n');
    }
    console.log('Next: ' + anIterator.next());
    console.log('Cur: ' + anIterator.cur);
}

anIterator = new RandomIterator({
    ceil: 25
});

console.log('\nRandom Iterator:\n');
console.log('Cur: ' + anIterator.cur);
for (var i = limit; 0 < i--;) {
    console.log('Next: ' + anIterator.next());
    console.log('Cur: ' + anIterator.cur);
}
{'fraction_non_alphanumeric': 0.2074688796680498, 'fraction_numerical': 0.01007705986959099, 'mean_word_length': 3.513368983957219, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1769229', 'n_tokens_mistral': 599, 'n_tokens_neox': 585, 'n_words': 128}