<commit_before>use v6;
use Nightscape::Parser;
class Nightscape;

method it($file) {
    say "________________________________________________________________________________";
    say "[CONFIG]";
    say %Config::CONFIG.perl;
    say "________________________________________________________________________________";
    my $content = slurp $file;
    if my $parsed = Nightscape::Parser.parse($content) {
        say "________________________________________________________________________________";
        say "[HEADER]";
        say $parsed.made.list[0]<journals>.pairs[2].value<journal><entries>.values[0]<entry><header>.perl;
        say "";
        say "[POSTINGS]";
        say $parsed.made.list[0]<journals>.pairs[2].value<journal><entries>.values[0]<entry><postings>.perl;
        say "________________________________________________________________________________";
        say "";
        say "________________________________________________________________________________";
        say "[HEADER]";
        say $parsed.made.list[0]<journals>.pairs[7].value<journal><entries>.values[0]<entry><header>.perl;
        say "";
        say "[POSTINGS]";
        say $parsed.made.list[0]<journals>.pairs[7].value<journal><entries>.values[0]<entry><postings>.perl;
        say "________________________________________________________________________________";
        say "";
        say "________________________________________________________________________________";
        say "[HEADER]";
        say $parsed.made.list[0]<journals>.pairs[9].value<journal><entries>.values[0]<entry><header>.perl;
        say "";
        say "[POSTINGS]";
        say $parsed.made.list[0]<journals>.pairs[9].value<journal><entries>.values[0]<entry><postings>.perl;
        say "________________________________________________________________________________";
        say "";
        say "________________________________________________________________________________";
        say "[HEADER]";
        say $parsed.made.list[0]<journals>.pairs[11].value<journal><entries>.values[0]<entry><header>.perl;
        say "";
        say "[POSTINGS]";
        say $parsed.made.list[0]<journals>.pairs[11].value<journal><entries>.values[0]<entry><postings>.perl;
        say "________________________________________________________________________________";
    }
}

# vim: ft=perl6<commit_msg>new method for printing output<commit_after>use v6;
use Nightscape::Parser;
class Nightscape;

method it($file) {
    say "________________________________________________________________________________";
    say "[CONFIG]";
    say %Config::CONFIG.perl;
    say "________________________________________________________________________________";
    my $content = slurp $file;
    if my $parsed = Nightscape::Parser.parse($content) {
        for $parsed.made.list -> $journal {
            for $journal.kv -> $key, $value {
                unless $key ~~ / blank_line || comment_line / {
                    say "[HEADER]" if $value.key ~~ /header/;
                    say "[POSTINGS]" if $value.key ~~ /postings/;
                    say $value.key.perl, " => ", $value.value.perl, "\n";
                }
            }
        };
    }
}

# vim: ft=perl6
{'fraction_non_alphanumeric': 0.13392857142857142, 'fraction_numerical': 0.009236453201970444, 'mean_word_length': 3.7569546120058566, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 46, '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': '1601347', 'n_tokens_mistral': 763, 'n_tokens_neox': 745, 'n_words': 123}