<commit_before>//
// Created by <NAME> on 11/7/17.
//
#include <iostream>

#include "envitools/ENVI.hpp"

namespace et = envitools;

int main(int argc, char* argv[])
{
    if (argc != 2) {
        std::cout << "Usage: [input.hdr] \n";
        return EXIT_FAILURE;
    }

    std::cout << "Filename: " << argv[1] << std::endl;
    et::ENVI::Pointer envi;
    try {
        envi = et::ENVI::New(argv[1]);
    } catch (const std::exception& e) {
        std::cerr << "Cannot open file as ENVI: ";
        std::cerr << e.what() << std::endl;
    }

    std::cout << "DataType: " << static_cast<int>(envi->datatype())
              << std::endl;

    std::cout << "Endianness: " << static_cast<int>(envi->endianness())
              << std::endl;

    std::cout << "Interleave: ";
    switch (envi->interleave()) {
        case et::ENVI::Interleave::BandSequential:
            std::cout << "BSQ";
            break;
        case et::ENVI::Interleave::BandByPixel:
            std::cout << "BIP";
            break;
        case et::ENVI::Interleave::BandByLine:
            std::cout << "BIL";
            break;
    }
    std::cout << std::endl;

    std::cout << "Samples (Width): " << envi->width() << std::endl;
    std::cout << "Lines (Height): " << envi->height() << std::endl;
    std::cout << "Bands (Depth): " << envi->bands() << std::endl;

    std::cout << "Band ID count: " << envi->getWavelengths().size()
              << std::endl;
    std::cout << "IDs:" << std::endl;
    int count = 0;
    for (const auto& w : envi->getWavelengths()) {
        std::cout << "    " << count++ << ": " << w << std::endl;
    }
}<commit_msg>(et_envi_info) Fix app not returning when file couldn't be loaded<commit_after>//
// Created by <NAME> on 11/7/17.
//
#include <iostream>

#include "envitools/ENVI.hpp"

namespace et = envitools;

int main(int argc, char* argv[])
{
    if (argc != 2) {
        std::cout << "Usage: [input.hdr] \n";
        return EXIT_FAILURE;
    }

    std::cout << "Filename: " << argv[1] << std::endl;
    et::ENVI::Pointer envi;
    try {
        envi = et::ENVI::New(argv[1]);
    } catch (const std::exception& e) {
        std::cerr << "Cannot open file as ENVI: ";
        std::cerr << e.what() << std::endl;
        return EXIT_FAILURE;
    }

    std::cout << "DataType: " << static_cast<int>(envi->datatype())
              << std::endl;

    std::cout << "Endianness: " << static_cast<int>(envi->endianness())
              << std::endl;

    std::cout << "Interleave: ";
    switch (envi->interleave()) {
        case et::ENVI::Interleave::BandSequential:
            std::cout << "BSQ";
            break;
        case et::ENVI::Interleave::BandByPixel:
            std::cout << "BIP";
            break;
        case et::ENVI::Interleave::BandByLine:
            std::cout << "BIL";
            break;
    }
    std::cout << std::endl;

    std::cout << "Samples (Width): " << envi->width() << std::endl;
    std::cout << "Lines (Height): " << envi->height() << std::endl;
    std::cout << "Bands (Depth): " << envi->bands() << std::endl;

    std::cout << "Band ID count: " << envi->getWavelengths().size()
              << std::endl;
    std::cout << "IDs:" << std::endl;
    int count = 0;
    for (const auto& w : envi->getWavelengths()) {
        std::cout << "    " << count++ << ": " << w << std::endl;
    }
}
{'fraction_non_alphanumeric': 0.2099612287503728, 'fraction_numerical': 0.0053683268714583956, 'mean_word_length': 2.374245472837022, 'pattern_counts': {'":': 2, '<': 159, '<?xml version=': 0, '>': 27, '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': '2718592', 'n_tokens_mistral': 1162, 'n_tokens_neox': 1142, 'n_words': 241}