<commit_before>#include "aquila/source/WaveFile.h"
#include <cstdlib>
#include <iostream>

int main(int argc, char *argv[])
{
    if (argc < 2)
    {
        std::cout << "Usage: wave_iteration <FILENAME> [<FRAMELENGTH>]" << std::endl;
        return 1;
    }

    int frameLength = 0; // frame length in milliseconds
    if (argc >= 3)
    {
        frameLength = std::atoi(argv[2]);
    }
    if (0 == frameLength)
    {
        frameLength = 20;
    }

    Aquila::WaveFile wav(argv[1]);

    return 0;
}<commit_msg>Added three iteration examples for WaveFile class.<commit_after>#include "aquila/global.h"
#include "aquila/source/WaveFile.h"
#include <algorithm>
#include <cstdlib>
#include <iostream>

int main(int argc, char *argv[])
{
    if (argc < 2)
    {
        std::cout << "Usage: wave_iteration <FILENAME> [<FRAMELENGTH>]" << std::endl;
        return 1;
    }

    int frameLength = 0; // frame length in milliseconds
    if (argc >= 3)
    {
        frameLength = std::atoi(argv[2]);
    }
    if (0 == frameLength)
    {
        frameLength = 20;
    }

    Aquila::WaveFile wav(argv[1]);
    std::cout << "Loaded file: " << wav.getFilename()
              << " (" << wav.getBitsPerSample() << "b)" << std::endl;
    Aquila::SampleType maxValue = 0, minValue = 0;

    // simple index-based iteration
    for (std::size_t i = 0; i < wav.getSamplesCount(); ++i)
    {
        if (wav.sample(i) > maxValue)
            maxValue = wav.sample(i);
    }
    std::cout << "Maximum sample value: " << maxValue << std::endl;

    // iterator usage
    for (Aquila::WaveFile::iterator it = wav.begin(); it != wav.end(); ++it)
    {
        if (*it < minValue)
            minValue = *it;
    }
    std::cout << "Minimum sample value: " << minValue << std::endl;

    // STL algorithms work too, so the previous examples could be rewritten
    // using max/min_element.
    int limit = 5000;
    int aboveLimit = std::count_if(wav.begin(), wav.end(),
                                   std::bind2nd(std::greater<int>(), limit));
    std::cout << "There are " << aboveLimit << " samples greater than "
              << limit << std::endl;

    return 0;
}
{'fraction_non_alphanumeric': 0.1614246068455134, 'fraction_numerical': 0.012950971322849213, 'mean_word_length': 2.4170616113744074, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6975359', 'n_tokens_mistral': 757, 'n_tokens_neox': 716, 'n_words': 180}