<commit_before>// Copyright Steinwurf ApS 2015.
// All Rights Reserved

#include <petro/parser.hpp>
#include <petro/box/all.hpp>

#include <iostream>
#include <fstream>
#include <sstream>
#include <memory>
#include <string>

void print_box(std::shared_ptr<petro::box::box> b, uint32_t level = 0)
{
    std::stringstream ss(b->describe());
    std::string line;
    while(std::getline(ss, line))
    {
        for (uint32_t i = 0; i < level; ++i)
        {
            std::cout << "    ";
        }
        std::cout << line << std::endl;
    }

    for(auto child : b->children())
    {
        print_box(child, level + 1);
    }
}

int main(int argc, char* argv[])
{
    if (argc != 2 || std::string(argv[1]) == "--help")
    {
        auto usage = "./complete_parser MP4_FILE";
        std::cout << usage << std::endl;
        return 0;
    }

    std::ifstream mp4_file(argv[1], std::ios::binary);

    if (not mp4_file.is_open() || not mp4_file.good())
    {
        std::cerr << "Error reading file" << std::endl;
        return 1;
    }
<commit_msg>don't use not use!<commit_after>// Copyright Steinwurf ApS 2015.
// All Rights Reserved

#include <petro/parser.hpp>
#include <petro/box/all.hpp>

#include <iostream>
#include <fstream>
#include <sstream>
#include <memory>
#include <string>

void print_box(std::shared_ptr<petro::box::box> b, uint32_t level = 0)
{
    std::stringstream ss(b->describe());
    std::string line;
    while(std::getline(ss, line))
    {
        for (uint32_t i = 0; i < level; ++i)
        {
            std::cout << "    ";
        }
        std::cout << line << std::endl;
    }

    for(auto child : b->children())
    {
        print_box(child, level + 1);
    }
}

int main(int argc, char* argv[])
{
    if (argc != 2 || std::string(argv[1]) == "--help")
    {
        auto usage = "./complete_parser MP4_FILE";
        std::cout << usage << std::endl;
        return 0;
    }

    std::ifstream mp4_file(argv[1], std::ios::binary);

    if (!mp4_file.is_open() || !mp4_file.good())
    {
        std::cerr << "Error reading file" << std::endl;
        return 1;
    }

{'fraction_non_alphanumeric': 0.18000947418285174, 'fraction_numerical': 0.018948365703458078, 'mean_word_length': 2.531772575250836, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 23, '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': '3838817', 'n_tokens_mistral': 784, 'n_tokens_neox': 752, 'n_words': 171}