line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Unicode::Confuse; |
2
|
1
|
|
|
1
|
|
58155
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
3
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
15
|
|
4
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
49
|
|
5
|
1
|
|
|
1
|
|
13
|
use utf8; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
require Exporter; |
7
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
8
|
|
|
|
|
|
|
our @EXPORT_OK = qw/confusable canonical/; |
9
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
10
|
|
|
|
|
|
|
all => \@EXPORT_OK, |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
13
|
1
|
|
|
1
|
|
580
|
use Unicode::Confuse::Regex; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
157
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $re = $Unicode::Confuse::Regex::re; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
533
|
use JSON::Parse 'read_json'; |
|
1
|
|
|
|
|
1039
|
|
|
1
|
|
|
|
|
163
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $jfile = __FILE__; |
20
|
|
|
|
|
|
|
$jfile =~ s!\.pm$!/confusables.json!; |
21
|
|
|
|
|
|
|
our $data = read_json ($jfile); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub confusable |
24
|
|
|
|
|
|
|
{ |
25
|
2
|
|
|
2
|
1
|
1320
|
my ($c) = @_; |
26
|
2
|
|
|
|
|
45
|
return $c =~ $re; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub canonical |
30
|
|
|
|
|
|
|
{ |
31
|
2
|
|
|
2
|
1
|
6
|
my ($c) = @_; |
32
|
2
|
50
|
|
|
|
20
|
if ($c =~ $re) { |
33
|
2
|
|
|
|
|
17
|
return $data->{confusables}{$c}; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |