<commit_before>package Business::DK::FI;

# $Id$

use strict;
use warnings;
use vars qw($VERSION @EXPORT_OK);
use Params::Validate qw(validate_pos SCALAR ARRAYREF);
use Readonly;
use base qw(Exporter);
use English qw( -no_match_vars );

$VERSION   = '0.05';
@EXPORT_OK = qw(validate validateFI generate);

use constant MODULUS_OPERAND => 10;
use constant THRESHOLD       => 10;
use constant DEDUCTION       => 9;
use constant INVALID         => 0;
use constant VALID           => 1;

Readonly my @CONTROLCIFERS  => qw(1 2 1 2 1 2 1 2 1 2 1 2 1 2);
Readonly my $CONTROL_LENGTH => scalar @CONTROLCIFERS;

## no critic (NamingConventions::Capitalization)

sub validateFI {
    return validate(shift);
}

sub validate {
    my ($fi_number) = @ARG;

    validate_pos( @ARG, { type => SCALAR, regex => qr/^\d{15}$/xsm } );

    my ($last_digit);
    ( $fi_number, $last_digit )<commit_msg>Qualified the Readonly datatypes more explicitly<commit_after>package Business::DK::FI;

# $Id$

use strict;
use warnings;
use vars qw($VERSION @EXPORT_OK);
use Params::Validate qw(validate_pos SCALAR ARRAYREF);
use Readonly;
use base qw(Exporter);
use English qw( -no_match_vars );

$VERSION   = '0.05';
@EXPORT_OK = qw(validate validateFI generate);

use constant MODULUS_OPERAND => 10;
use constant THRESHOLD       => 10;
use constant DEDUCTION       => 9;
use constant INVALID         => 0;
use constant VALID           => 1;

Readonly::Array my @CONTROLCIFERS  => qw(1 2 1 2 1 2 1 2 1 2 1 2 1 2);
Readonly::Scalar my $CONTROL_LENGTH => scalar @CONTROLCIFERS;

## no critic (NamingConventions::Capitalization)

sub validateFI {
    return validate(shift);
}

sub validate {
    my ($fi_number) = @ARG;

    validate_pos( @ARG, { type => SCALAR, regex => qr/^\d{15}$/xsm } );

    my ($last_digit);
    ( $fi_number, $last_digit )
{'fraction_non_alphanumeric': 0.1277533039647577, 'fraction_numerical': 0.028634361233480177, 'mean_word_length': 3.8324468085106385, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '5485203', 'n_tokens_mistral': 698, 'n_tokens_neox': 638, 'n_words': 195}