Blacklist Classifier / Lingua-Identify-Blacklists / t / 30_train.t

#!/usr/bin/env perl
#-*-perl-*-

use utf8;
use Test::More;
use File::Compare;

use FindBin qw/$Bin/;
use lib "$Bin/..";

use Lingua::Identify::Blacklists ':all';

$Lingua::Identify::Blacklists::BLACKLISTDIR = "$Bin/blacklists";


my %files = ( bs => "$Bin/data/eval/dnevniavaz.ba.200.check",
	      hr => "$Bin/data/eval/vecernji.hr.200.check",
	      sr => "$Bin/data/eval/politika.rs.200.check" );

train( \%files );

my @langs = keys %files;

for my $s (0..$#langs){
    for my $t ($s+1..$#langs){
	is ( compare( "$Bin/data/blacklists/$langs[$s]-$langs[$t].txt", 
		      "$Bin/blacklists/$langs[$s]-$langs[$t].txt"), 
	     0, "$langs[$s]-$langs[$t] blacklist" );
    }
}


done_testing;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.