<commit_before>#!/usr/bin/perl

# test MediaWords::Crawler::Extractor against manually extracted downloads

use strict;

BEGIN
{
    use FindBin;
    use lib "$FindBin::Bin/../lib";
}

use Readonly;

use Test::NoWarnings;
use Test::More tests => 438 + 1;
use utf8;

use Lingua::Stem;
use Lingua::Stem::Ru;
use Data::Dumper;

use MediaWords::Util::Countries;

{

    my $all_countries = [ sort map { lc } @{ MediaWords::Util::Countries::get_countries_for_counts() } ];

    foreach my $country ( @{ $all_countries } )
    {
        ok( MediaWords::Util::Countries::_get_country_data_base_value( $country ), "database value: $country" );
        my $country_db_value = MediaWords::Util::Countries::_get_country_data_base_value( $country );
        ok( MediaWords::Util::Countries::get_country_code_for_stemmed_country_name( $country_db_value ),
            "database value: $country" );

    }
}<commit_msg>Countries.pm tests use English by default<commit_after>#!/usr/bin/perl

# test MediaWords::Crawler::Extractor against manually extracted downloads

use strict;

BEGIN
{
    use FindBin;
    use lib "$FindBin::Bin/../lib";
}

use Readonly;

use Test::NoWarnings;
use Test::More tests => 438 + 1;
use utf8;

use Lingua::Stem;
use Lingua::Stem::Ru;
use Data::Dumper;

use MediaWords::Util::Countries;

{

    my $all_countries = [ sort map { lc } @{ MediaWords::Util::Countries::get_countries_for_counts( 'en' ) } ];

    foreach my $country ( @{ $all_countries } )
    {
        ok( MediaWords::Util::Countries::_get_country_data_base_value( $country, 'en' ), "database value: $country" );
        my $country_db_value = MediaWords::Util::Countries::_get_country_data_base_value( $country, 'en' );
        ok( MediaWords::Util::Countries::get_country_code_for_stemmed_country_name( $country_db_value, 'en' ),
            "database value: $country" );

    }
}
{'fraction_non_alphanumeric': 0.14500537056928034, 'fraction_numerical': 0.0053705692803437165, 'mean_word_length': 4.511834319526627, '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': '2343028', 'n_tokens_mistral': 673, 'n_tokens_neox': 639, 'n_words': 129}