line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ################################################################### Otakar Smrz, 2003/01/23 |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Encoding of Arabic: ArabTeX Notation by Klaus Lagally ##################################### |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# $Id: RE.pm 143 2006-11-15 01:16:57Z smrz $ |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Encode::Arabic::ArabTeX::ZDMG::RE; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
28795
|
use 5.008; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
84
|
|
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
65
|
|
12
|
2
|
|
|
2
|
|
15
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
236
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = do { q $Revision: 143 $ =~ /(\d+)/; sprintf "%4.2f", $1 / 100 }; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub import { # perform import as if Encode were used one level before this module |
18
|
2
|
|
|
2
|
|
22
|
require Encode; |
19
|
2
|
|
|
|
|
55
|
Encode->export_to_level(1, @_); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
2
|
|
926
|
use Encode::Encoding; |
|
2
|
|
|
|
|
18549
|
|
|
2
|
|
|
|
|
59
|
|
24
|
2
|
|
|
2
|
|
21
|
use base 'Encode::Encoding'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
1284
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__PACKAGE__->Define('ZDMG-RE', 'ArabTeX-ZDMG-RE'); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
our (%encode_used, %decode_used, @shams, @qamar); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub encode ($$;$$) { |
33
|
0
|
|
|
0
|
1
|
|
my (undef, $text, $check, $mode) = @_; |
34
|
|
|
|
|
|
|
|
35
|
0
|
0
|
|
|
|
|
$_[1] = '' if $check; # this is what in-place edit needs |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
require Encode; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
Encode::_utf8_off($text); |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
return $text; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub decode ($$;$) { |
46
|
0
|
|
|
0
|
1
|
|
my (undef, $text, $check) = @_; |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
$_[1] = '' if $check; # this is what in-place edit needs |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
for ($text) { |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
s/NY/n/g; |
53
|
0
|
|
|
|
|
|
s/UA/u\x{0304}/g; |
54
|
0
|
|
|
|
|
|
s/WA/w/g; |
55
|
0
|
|
|
|
|
|
s/_a/a\x{0304}/g; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
s/N/n/g; |
58
|
0
|
|
|
|
|
|
s/Y/a\x{0304}/g; |
59
|
0
|
|
|
|
|
|
s/T/t/g; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
#s/y/j/g; |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
s/\\cap\s+([\._\^]?)([a-zAIU])/$1\*$2/g; |
64
|
0
|
|
|
|
|
|
s/\\cap\s+(['`])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