-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.t
76 lines (74 loc) · 2.14 KB
/
test.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env perl
# Testing DZ Interset 2.0.
# Copyright © 2014, 2015 Dan Zeman <[email protected]>
# Licence: GNU GPL
use utf8;
use open ':utf8';
binmode(STDIN, ':utf8');
binmode(STDOUT, ':utf8');
binmode(STDERR, ':utf8');
# We must declare in advance how many tests we are going to perform.
# There are currently three tests per tagset driver.
use Test::More tests => 64*3;
use Lingua::Interset qw(get_driver_object);
use Lingua::Interset::Tagset;
# Run standard driver tests for all drivers that are part of the release.
###!!! Exclude selected tagsets that are too large: cs::conll cs::conll2009 cs::cnk cs::pmk mul::uposf ur::conll
my @tagsets =
(
'ar::padt', 'ar::conll', 'ar::conll2007',
'bg::conll',
'bn::conll',
'ca::conll2009',
'cs::pdt', 'cs::pdtc', 'cs::ridics', 'cs::ajka', 'cs::multext', 'cs::pmkkr',
'da::conll',
'de::stts', 'de::conll2009', 'de::smor',
'el::conll',
'en::penn', 'en::conll', 'en::conll2009',
'et::puudepank',
'eu::conll',
'fa::conll',
'fi::turku',
'fo::setur',
'grc::conll',
'he::conll',
'hi::conll',
'hr::multext',
'hsb::sorokin',
'hu::conll',
'it::conll',
'ja::conll', 'ja::ipadic',
'la::conll', 'la::it', 'la::itconll',
'lt::jablonskis', 'lt::multext',
'mt::mlss',
'mul::google', 'mul::upos', 'mul::unimorph',
'nl::cgn', 'nl::conll',
'no::conll',
'pl::ipipan',
'pt::cintil', 'pt::conll',
'ro::multext', 'ro::rdt',
'ru::syntagrus',
'sk::snk',
'sl::multext', 'sl::conll',
'sv::mamba', 'sv::conll', 'sv::parole', 'sv::suc',
'ta::tamiltb',
'te::conll',
'tr::conll',
'ug::udt',
'zh::conll'
);
foreach my $tagset (@tagsets)
{
print STDERR ("Now testing the driver for the tagset '$tagset'...\n");
my $driver = get_driver_object($tagset);
ok(defined($driver), "tagset driver '$tagset' object defined");
my $list = $driver->list();
my $n = scalar(@{$list});
ok($n > 0, "'$tagset' has non-empty list of tags");
my @errors = $driver->test();
if(@errors)
{
print STDERR (join('', @errors), "\n");
}
ok(!@errors, "'$tagset' driver integrity test");
}