<commit_before>#!perl
#This program is free software. You may redistribute it under the terms of the Artistic License 2.0.
package Cores;

use 5.012;
use warnings;

our $VERSION = v1;

use Core::AnyManga;
use Core::Comcol;
use Core::ComicGenesis;
use Log;

my $l = Log->new();
my %cores = (	'Core::AnyManga' => 1,
				'Core::Comcol' => 1,
				'Core::ComicGenesis' => 1,
				);

#->@cores
#returns the list of used cores
sub list {
	$l->trace('core list requested');
	return keys %cores;
}

#initialises all used cores
sub init {
	$l->trace('initialising cores');
	for (list()) {
		unless ($_->init()) {
			delete $cores{$_};
		}
	}
}

1;<commit_msg>changed way Cores handles "not in use" cores<commit_after>#!perl
#This program is free software. You may redistribute it under the terms of the Artistic License 2.0.
package Cores;

use 5.012;
use warnings;

our $VERSION = v1;

use Core::AnyManga;
use Core::Comcol;
use Core::ComicGenesis;
use Log;

my $l = Log->new();
my %cores = (	'Core::AnyManga' => 1,
				'Core::Comcol' => 1,
				'Core::ComicGenesis' => 1,
				);

#->@cores
#returns the list of used cores
sub list {
	$l->trace('core list requested');
	return grep {$cores{$_} } keys %cores;
}

#initialises all used cores
sub init {
	$l->trace('initialising cores');
	for (list()) {
		unless ($_->init()) {
			$cores{$_} = 0;
		}
	}
	return 1;
}

1;
{'fraction_non_alphanumeric': 0.16666666666666666, 'fraction_numerical': 0.017699115044247787, 'mean_word_length': 3.898916967509025, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '5722940', 'n_tokens_mistral': 566, 'n_tokens_neox': 501, 'n_words': 162}