| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package EBook::Ishmael::CharDet::ISO88595; |
|
2
|
18
|
|
|
18
|
|
310
|
use 5.016; |
|
|
18
|
|
|
|
|
115
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '2.03'; |
|
4
|
18
|
|
|
18
|
|
116
|
use strict; |
|
|
18
|
|
|
|
|
39
|
|
|
|
18
|
|
|
|
|
544
|
|
|
5
|
18
|
|
|
18
|
|
101
|
use warnings; |
|
|
18
|
|
|
|
|
51
|
|
|
|
18
|
|
|
|
|
992
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
18
|
|
|
18
|
|
110
|
use parent 'EBook::Ishmael::CharDet::CP'; |
|
|
18
|
|
|
|
|
34
|
|
|
|
18
|
|
|
|
|
119
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Generated from contrib/512-bigram.pl trained on various Russian, Bulgarian, |
|
10
|
|
|
|
|
|
|
# Belarusian, and Serbian texts from Wikisource. |
|
11
|
|
|
|
|
|
|
my %ISO88595_FREQS = map { $_ => 1 } ( |
|
12
|
|
|
|
|
|
|
"\xe1\xe2","\xe2\xde","\xd5\xdd","\xdd\xde","\xdd\xd8","\xdd\xd0","\xe0\xd0", |
|
13
|
|
|
|
|
|
|
"\xdd\xd5","\xda\xde","\xd3\xde","\xde\xd2","\xe0\xde","\xdf\xde","\xd5\xe0", |
|
14
|
|
|
|
|
|
|
"\xde\xe1","\xe0\xd5","\xd2\xde","\xdf\xe0","\xdb\xd8","\xde\xe0","\xd0\xdb", |
|
15
|
|
|
|
|
|
|
"\xde\xe2","\xd5\xdb","\xd2\xd5","\xd5\xe2","\xd0\xdd","\xd5\xe1","\xe2\xd5", |
|
16
|
|
|
|
|
|
|
"\xde\xdb","\xda\xd0","\xe2\xd0","\xde\xdc","\xdb\xde","\xd2\xd0","\xe1\xda", |
|
17
|
|
|
|
|
|
|
"\xde\xd4","\xe0\xd8","\xdb\xd5","\xe2\xec","\xde\xd3","\xe2\xd8","\xd4\xd5", |
|
18
|
|
|
|
|
|
|
"\xde\xdd","\xd0\xe2","\xd5\xdc","\xdb\xd0","\x2d\x2d","\xdc\xd5","\xdd\xeb", |
|
19
|
|
|
|
|
|
|
"\xd8\xe2","\xdb\xec","\xe7\xd5","\xd4\xd0","\xd0\xda","\xde\xd1","\xde\xd9", |
|
20
|
|
|
|
|
|
|
"\xd8\xe1","\xe2\xd2","\xd4\xde","\xd8\xdb","\xd8\xdd","\xd8\xdc","\xd7\xd0", |
|
21
|
|
|
|
|
|
|
"\xdd\xdd","\xd5\xd4","\xd0\xe1","\xdc\xde","\xd2\xd8","\xe2\xe0","\xe1\xde", |
|
22
|
|
|
|
|
|
|
"\xd8\xd5","\xe1\xef","\xd0\xe0","\xda\xd8","\xd6\xd5","\xd8\xd7","\xd0\xd2", |
|
23
|
|
|
|
|
|
|
"\xd0\xdc","\xd0\xd7","\xdc\xd8","\xe1\xd5","\xd5\xd3","\xd8\xef","\xd1\xeb", |
|
24
|
|
|
|
|
|
|
"\xdc\xd0","\x3c\x3c","\xde\xd5","\x3e\x3e","\xe1\xdb","\xe0\xe3","\xd5\xd9", |
|
25
|
|
|
|
|
|
|
"\xe7\xe2","\xd4\xd8","\xd1\xde","\xd2\xe1","\xd8\xda","\xe7\xd0","\xd0\x2c", |
|
26
|
|
|
|
|
|
|
"\xe1\xec","\xd8\xe5","\xd5\xda","\xdf\xd5","\xd8\x2c","\xd0\xef","\xd2\xeb", |
|
27
|
|
|
|
|
|
|
"\xd8\xd2","\xd8\xe7","\xd8\xd9","\xd5\x2c","\xe8\xd5","\xde\xda","\xe3\xd4", |
|
28
|
|
|
|
|
|
|
"\xd1\xd5","\xe1\xd2","\xd4\xe3","\xdc\xe3","\xdb\xef","\xd0\xd4","\xd5\xd2", |
|
29
|
|
|
|
|
|
|
"\xe2\xe1","\xd4\xdd","\xed\xe2","\xe9\xd5","\xde\x2c","\xd8\xd8","\xeb\xdb", |
|
30
|
|
|
|
|
|
|
"\xeb\xd9","\xde\xd6","\xd0\xd5","\xe1\xd0","\xec\xdd","\xe7\xd8","\xd7\xdd", |
|
31
|
|
|
|
|
|
|
"\xe1\xd8","\xde\xdf","\x2e\x2e","\xd5\xd5","\xe5\xde","\xdf\xd8","\xdd\xe3", |
|
32
|
|
|
|
|
|
|
"\xe6\xd5","\xde\xe7","\xe0\xeb","\xd8\xd4","\xef\x2c","\xd5\xe7","\xef\xe2", |
|
33
|
|
|
|
|
|
|
"\xe3\xe2","\xe2\xdd","\xeb\xd5","\xda\xe0","\xdd\xef","\xe1\xdf","\xeb\xe5", |
|
34
|
|
|
|
|
|
|
"\xdc\xdd","\xd6\xd8","\xeb\xdc","\xe8\xd8","\xd8\xe0","\xdc\x2c","\xde\xd7", |
|
35
|
|
|
|
|
|
|
"\xd1\xe0","\xd2\xdb","\xe2\xe3","\xe3\xee","\xd5\xd7","\xe6\xd8","\xd3\xd0", |
|
36
|
|
|
|
|
|
|
"\xec\x2c","\xd7\xd2","\xdc\xeb","\xda\xe3","\xd4\xe0","\xde\xd8","\xe2\xeb", |
|
37
|
|
|
|
|
|
|
"\xdb\xe3","\xdf\xd0","\xdb\xee","\xd3\xe0","\xe3\xe1","\xd2\xdd","\xd9\x2c", |
|
38
|
|
|
|
|
|
|
"\xe0\xdd","\x31\x38","\xe1\xe1","\xd0\xe5","\xd5\xd1","\xd6\xd4","\xe1\xdd", |
|
39
|
|
|
|
|
|
|
"\xd1\xdb","\xd0\xee","\xd7\xd4","\xd0\xd6","\xd3\xdb","\xd5\xd6","\xe3\xdc", |
|
40
|
|
|
|
|
|
|
"\xe0\xef","\xe1\xe3","\xdd\xec","\xe3\xd6","\xdd\xe2","\xd0\x2e","\xeb\xd2", |
|
41
|
|
|
|
|
|
|
"\xd6\xd0","\xd3\xd8","\xe3\xe7","\xd6\xdd","\xd3\xd4","\xd0\xe7","\xdc\x2e", |
|
42
|
|
|
|
|
|
|
"\xe1\xdc","\xd1\xe3","\xd2\xe0","\xec\xe1","\xd0\xdf","\xe3\x2c","\xdd\xe1", |
|
43
|
|
|
|
|
|
|
"\xd8\xe6","\xe3\xd3","\xe9\xd8","\xd0\xd1","\xd4\xd2","\xd8\x2e","\xe3\xe0", |
|
44
|
|
|
|
|
|
|
"\xd2\xe3","\xda\xe2","\xd5\xdf","\xe7\xdd","\xe2\x2c","\xdb\xe1","\xde\xe8", |
|
45
|
|
|
|
|
|
|
"\xeb\x2c","\xee\xe2","\xd4\xdb","\xe3\xda","\xd0\xd3","\xd7\xde","\xd5\x2e", |
|
46
|
|
|
|
|
|
|
"\xe3\xd1","\xe0\xe6","\xe0\xe2","\xde\xee","\xdf\xdb","\xd7\xd8","\xb3\xd5", |
|
47
|
|
|
|
|
|
|
"\xd0\xe8","\xd1\xd8","\xeb\xe1","\xd4\xeb","\xdd\xe6","\xde\xef","\xd8\xd3", |
|
48
|
|
|
|
|
|
|
"\xec\xda","\xda\xdb","\xd8\xd1","\xdf\xe3","\xe6\xd0","\xd4\xe1","\xe8\xd0", |
|
49
|
|
|
|
|
|
|
"\xef\xdd","\xd8\xee","\xd2\xe8","\xd9\xe1","\xee\xe9","\xeb\xe2","\xd3\xe3", |
|
50
|
|
|
|
|
|
|
"\xe3\xe8","\xe3\xdf","\xd3\xd5","\xe5\xd0","\x29\x2e","\xd1\xd0","\xbf\xde", |
|
51
|
|
|
|
|
|
|
"\xee\x2c","\xd5\xe9","\x3e\x2c","\xd7\xeb","\xd8\xd0","\xda\xd5","\xe0\xe1", |
|
52
|
|
|
|
|
|
|
"\xd5\xde","\xd7\xdc","\xe0\xd3","\xef\xe1","\xef\x2e","\xe0\xec","\xec\xd5", |
|
53
|
|
|
|
|
|
|
"\xdb\x2c","\xda\xdd","\xe3\xdb","\xd7\xd5","\xbf\xe0","\xd2\x2c","\xdd\xd4", |
|
54
|
|
|
|
|
|
|
"\xd5\xe8","\xec\xdc","\xdb\xdd","\xe0\xd2","\xd5\xe5","\xd0\xd9","\xe3\xd2", |
|
55
|
|
|
|
|
|
|
"\xef\xdc","\x31\x37","\xe0\x2e","\xdb\xeb","\xde\x2e","\xe2\xda","\xe2\xef", |
|
56
|
|
|
|
|
|
|
"\xe5\x2c","\x29\x2c","\xdc\xef","\xba\xd0","\xe7\xe3","\x2e\x29","\x3e\x2e", |
|
57
|
|
|
|
|
|
|
"\x65\x72","\xd8\xde","\xd3\x2e","\xe3\xe9","\xe4\xd8","\xef\xdb","\xd9\x2e", |
|
58
|
|
|
|
|
|
|
"\xda\xe1","\xdd\x2c","\xe2\x2e","\x2d\x31","\xef\xd7","\xef\xd2","\xe9\xd0", |
|
59
|
|
|
|
|
|
|
"\xbd\xde","\xd5\xe6","\x65\x6e","\xe5\xd8","\x69\x73","\x38\x33","\xd8\xd6", |
|
60
|
|
|
|
|
|
|
"\xe0\xe5","\xec\xee","\xda\x2c","\xe3\xdd","\xd1\xe9","\xe3\xe5","\xe0\xdc", |
|
61
|
|
|
|
|
|
|
"\xbd\xd0","\xd1\xdd","\x6f\x6e","\xe0\xd6","\xd2\xef","\xe3\xd7","\xd9\xdd", |
|
62
|
|
|
|
|
|
|
"\xef\xe9","\xec\x2e","\x28\x31","\xbf\xd5","\xbd\xd5","\xeb\xe8","\xdb\xd6", |
|
63
|
|
|
|
|
|
|
"\x2d\xe2","\x27\x27","\xe1\xeb","\x69\x6e","\xd7\xe0","\xd8\xe8","\xde\xe5", |
|
64
|
|
|
|
|
|
|
"\xec\xef","\xe3\x2e","\xee\xd4","\xef\xd5","\xe0\xd4","\xd2\xd7","\xd4\xec", |
|
65
|
|
|
|
|
|
|
"\xd8\xdf","\xd7\xe3","\xe4\xe0","\xd0\x3e","\x74\x65","\xd2\x2e","\xd4\x2e", |
|
66
|
|
|
|
|
|
|
"\xd2\xe2","\x64\x65","\xe5\xe0","\xbc\xde","\x6f\x72","\xd5\xee","\xda\xd2", |
|
67
|
|
|
|
|
|
|
"\xe3\xd5","\xdb\xdb","\xe0\xda","\xc1\xe2","\xdc\xdb","\xbe\xdd","\xde\xe4", |
|
68
|
|
|
|
|
|
|
"\xd4\xef","\xb7\xd0","\x65\x73","\xee\xd1","\xd0\xe4","\xeb\x2e","\x72\x65", |
|
69
|
|
|
|
|
|
|
"\xd5\xef","\xb3\xde","\xec\xe8","\xd3\xdd","\xeb\xe0","\xd6\xe3","\xd1\xef", |
|
70
|
|
|
|
|
|
|
"\xef\xd4","\xd1\xe1","\xde\x2d","\xde\xde","\xc0\xd5","\xba\xde","\xe8\xdd", |
|
71
|
|
|
|
|
|
|
"\x49\x49","\x75\x72","\xe4\xde","\xe8\xdb","\xd7\xdb","\x6c\x65","\x74\x69", |
|
72
|
|
|
|
|
|
|
"\xb0\x2e","\xef\xe5","\xd8\x3e","\xd7\xef","\xbc\xd0","\xe1\xe7","\xb2\xde", |
|
73
|
|
|
|
|
|
|
"\xd0\xe9","\x6c\x69","\xe4\xd0","\x31\x39","\xd0\xe6","\xdf\xeb","\xc2\xd0", |
|
74
|
|
|
|
|
|
|
"\xdd\xd3","\x61\x6e","\xde\xe6","\xc0\xd0","\xdb\xda","\xe1\xe0","\xcd\xe2", |
|
75
|
|
|
|
|
|
|
"\xe0\x2c","\x72\x69","\xe0\xe8","\xdd\x2e","\xdb\x2e","\xdd\xda","\x2e\x3e", |
|
76
|
|
|
|
|
|
|
"\xd7\xec","\x28\xe1","\xd2\xda","\xdc\xdf","\x61\x74","\xeb\xda","\xd2\xdf", |
|
77
|
|
|
|
|
|
|
"\xe8\xec","\xb2\xd5","\xbf\xd0","\x6f\x75","\xee\x2e","\xe1\xe5","\x69\x65", |
|
78
|
|
|
|
|
|
|
"\xe5\x2e","\xd5\xd8","\xe4\xd5","\xd8\xe9","\x73\x74","\x63\x65","\x63\x68", |
|
79
|
|
|
|
|
|
|
"\xe1\xd4","\xef\xda","\xb2\xd8","\xeb\xdd","\xd7\xd3","\xe8\xe3","\xd5\x3e", |
|
80
|
|
|
|
|
|
|
"\xbc\xd5","\x69\x74","\xe7\xec","\x68\x65","\xe8\xda","\xe2\xdb","\x28\x3c", |
|
81
|
|
|
|
|
|
|
"\x6e\x65","\xe8\xde","\x61\x72","\xee\xe7","\xd0\xe3","\xd0\xd8","\xe3\xd0", |
|
82
|
|
|
|
|
|
|
"\xd5\xd0","\x3e\x29","\x6e\x73","\x6f\x6d","\xd9\xe8","\xdc\xe1","\xb0\xdb", |
|
83
|
|
|
|
|
|
|
"\xef\xee","\x73\x65","\xdc\xdc","\xe6\xde","\xdd\xe7","\xde\x3a","\xde\xe9", |
|
84
|
|
|
|
|
|
|
"\xe7\xda","\x3c\xbf","\xb4\xd0","\x61\x6c","\x31\x36","\xec\xd7","\xd1\xea", |
|
85
|
|
|
|
|
|
|
"\xd2\xec", |
|
86
|
|
|
|
|
|
|
); |
|
87
|
|
|
|
|
|
|
my $DIST_RATIO = '0.91'; |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
my %CHARSET_SPACE_SET = map { $_ => 1 } ( |
|
90
|
|
|
|
|
|
|
"\xa0", # NBSP |
|
91
|
|
|
|
|
|
|
); |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
my %IGNORE = ( |
|
94
|
|
|
|
|
|
|
%EBook::Ishmael::CharDet::Constants::ASCII_SPACE_SET, |
|
95
|
|
|
|
|
|
|
%CHARSET_SPACE_SET, |
|
96
|
|
|
|
|
|
|
); |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub ignore { |
|
99
|
|
|
|
|
|
|
|
|
100
|
548864
|
|
|
548864
|
0
|
890391
|
my ($self, $byte) = @_; |
|
101
|
|
|
|
|
|
|
|
|
102
|
548864
|
|
|
|
|
1434406
|
return exists $IGNORE{ $byte }; |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
} |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub freq_bigram { |
|
107
|
|
|
|
|
|
|
|
|
108
|
420149
|
|
|
420149
|
0
|
699762
|
my ($self, $bigram) = @_; |
|
109
|
|
|
|
|
|
|
|
|
110
|
420149
|
|
|
|
|
1109750
|
return exists $ISO88595_FREQS{ $bigram }; |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
} |
|
113
|
|
|
|
|
|
|
|
|
114
|
0
|
|
|
0
|
0
|
0
|
sub dist_ratio { $DIST_RATIO } |
|
115
|
|
|
|
|
|
|
|
|
116
|
67
|
|
|
67
|
0
|
251
|
sub encoding { 'iso-8859-5' } |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
1; |
|
119
|
|
|
|
|
|
|
|