line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Unicode::Confuse; |
2
|
1
|
|
|
1
|
|
77011
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
39
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
4
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
58
|
|
5
|
1
|
|
|
1
|
|
17
|
use utf8; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
9
|
|
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.04'; |
13
|
1
|
|
|
1
|
|
734
|
use Unicode::Confuse::Regex; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
222
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $re = $Unicode::Confuse::Regex::re; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
713
|
use JSON::Parse 'read_json'; |
|
1
|
|
|
|
|
1487
|
|
|
1
|
|
|
|
|
213
|
|
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
|
1466
|
my ($c) = @_; |
26
|
2
|
|
|
|
|
37
|
return $c =~ $re; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub canonical |
30
|
|
|
|
|
|
|
{ |
31
|
2
|
|
|
2
|
1
|
7
|
my ($c) = @_; |
32
|
2
|
50
|
|
|
|
24
|
if ($c =~ $re) { |
33
|
2
|
|
|
|
|
18
|
return $data->{confusables}{$c}; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |