<commit_before>package DataStore;
use Storable;
use Data::Dumper;


sub new {
    my $class = shift;
    return bless {}, $class;
}

sub load {
    my $self = shift;
    my $data;
    if(-e 'data.db'){
    	$data = retrieve('data.db') or die;
    }
    return $data;
}

sub save {
    my $self = shift;
    nstore($self, 'data.db') or die;
}

1;<commit_msg>Afegida funcio add.<commit_after>package DataStore;
use Storable;
use Data::Dumper;


sub new {
    my $class = shift;
    return bless [], $class;
}

sub add {
    my $self = shift;
    my $data = @_;
    push @$self, $data;
}

sub load {
    my $self = shift;
    my $data;
    if(-e 'data.db'){
    	$data = retrieve('data.db') or die;
    }
    return $data;
}

sub save {
    my $self = shift;
    my $dades = @_;
    nstore($dades, 'data.db') or die;
}

1;
{'fraction_non_alphanumeric': 0.1623931623931624, 'fraction_numerical': 0.002442002442002442, 'mean_word_length': 2.4166666666666665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4776460', 'n_tokens_mistral': 325, 'n_tokens_neox': 322, 'n_words': 91}