<commit_before>package App::Ack::ConfigLoader;

use strict;
use warnings;

use Carp ();
use Getopt::Long ();

=head1 App::Ack::ConfigLoader

=head1 FUNCTIONS

=head2 process_args( @sources )



=cut

sub process_filetypes {
    my @arg_sources = @_;

    Getopt::Long::Configure('default'); # start with default options
    Getopt::Long::Configure(
        'no_ignore_case',
        'no_auto_abbrev',
        'pass_through',
    );
    my %additional_specs;

    my $add_spec = sub {
        my ( undef, $spec ) = @_;

        if($spec =~ /^(\w+)=/) {
            $additional_specs{$1} = sub {}; # XXX do something about it!
        }
    };

    my %type_arg_specs = (
        'type-add=s' => $add_spec,
        'type-set=s' => $add_spec, # XXX same as add (for now)
    );

    for(my $i = 0; $i < @arg_sources; $i += 2) {<commit_msg>Start on process_filter_spec function<commit_after>package App::Ack::ConfigLoader;

use strict;
use warnings;

use Carp ();
use Getopt::Long ();

=head1 App::Ack::ConfigLoader

=head1 FUNCTIONS

=head2 process_args( @sources )



=cut

sub process_filter_spec {
    my ( $spec ) = @_;

    if($spec =~ /^(\w+)=/) {
        return ( $1 );
    } else {
        Carp::croak "invalid filter specification '$spec'";
    }
}

sub process_filetypes {
    my @arg_sources = @_;

    Getopt::Long::Configure('default'); # start with default options
    Getopt::Long::Configure(
        'no_ignore_case',
        'no_auto_abbrev',
        'pass_through',
    );
    my %additional_specs;

    my $add_spec = sub {
        my ( undef, $spec ) = @_;

        if($spec =~ /^(\w+)=/) {
            $additional_specs{$1} = sub {}; # XXX do something about it!
        }
    };

    my %type_arg_specs = (
        'type-add=s' => $add_spec,
        'type-set=s' => $add_spec, # XXX same as add (for now)
    );

    for(my $i = 0; $i < @arg_sources; $i += 2) {
{'fraction_non_alphanumeric': 0.16436170212765958, 'fraction_numerical': 0.006914893617021276, 'mean_word_length': 2.5357142857142856, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '296163', 'n_tokens_mistral': 700, 'n_tokens_neox': 667, 'n_words': 151}