<commit_before>package Sisimai::Data::YAML;
use feature ':5.10';
use strict;
use warnings;

sub dump {
    # Data dumper(YAML)
    # @param    [Sisimai::Data] argvs   Object
    # @return   [String, Undef]         Dumped data or Undef if the argument is
    #                                   missing
    my $class = shift;
    my $argvs = shift // return undef;

    return undef unless ref $argvs eq 'Sisimai::Data';
    my $damneddata = undef;
    my $yamlstring = undef;
    my $modulename = undef;

    eval {
        require YAML;
        $modulename = 'YAML';
    };

    if( $@ ) {
        # Try to load JSON::Syck
        eval { 
            require YAML::Syck;
            $modulename = 'YAML::Syck';
        };

        # YAML::Syck is not installed
        die ' ***error: Neither "YAML" nor "YAML::Syck" module is installed' if $@;
    }

    $damneddata = $argvs->damn;
    if( $modulename eq 'YAML' ) {
        # Use YAML module
        $YAML::SortKeys       = 1;
        $YAML::Stringify      = 0;
        $YAML::UseHeader      = 1;
        $YAML::UseBlock       = 0;
        $YAML::CompressSeries = 0;
        $yamlstring = YAML::Dump($damneddata);

    } elsif( $modulename eq 'YAML::Syck' ) {
        # Use JSON::Syck module instead of YAML module.
        $YAML::Syck::ImplicitTyping  = 1;<commit_msg>Fix module names in some comments<commit_after>package Sisimai::Data::YAML;
use feature ':5.10';
use strict;
use warnings;

sub dump {
    # Data dumper(YAML)
    # @param    [Sisimai::Data] argvs   Object
    # @return   [String, Undef]         Dumped data or Undef if the argument is
    #                                   missing
    my $class = shift;
    my $argvs = shift // return undef;

    return undef unless ref $argvs eq 'Sisimai::Data';
    my $damneddata = undef;
    my $yamlstring = undef;
    my $modulename = undef;

    eval {
        require YAML;
        $modulename = 'YAML';
    };

    if( $@ ) {
        # Try to load YAML::Syck
        eval { 
            require YAML::Syck;
            $modulename = 'YAML::Syck';
        };

        # YAML::Syck is not installed
        die ' ***error: Neither "YAML" nor "YAML::Syck" module is installed' if $@;
    }

    $damneddata = $argvs->damn;
    if( $modulename eq 'YAML' ) {
        # Use YAML module
        $YAML::SortKeys       = 1;
        $YAML::Stringify      = 0;
        $YAML::UseHeader      = 1;
        $YAML::UseBlock       = 0;
        $YAML::CompressSeries = 0;
        $yamlstring = YAML::Dump($damneddata);

    } elsif( $modulename eq 'YAML::Syck' ) {
        # Use YAML::Syck module instead of YAML module.
        $YAML::Syck::ImplicitTyping  = 1;
{'fraction_non_alphanumeric': 0.12687687687687688, 'fraction_numerical': 0.006756756756756757, 'mean_word_length': 1.8779697624190064, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4086823', 'n_tokens_mistral': 976, 'n_tokens_neox': 886, 'n_words': 236}