| 8 |
# The script is rather slow because it just searches linearly through the |
# The script is rather slow because it just searches linearly through the |
| 9 |
# Scripts data in order to find the script for each character or character |
# Scripts data in order to find the script for each character or character |
| 10 |
# range. It could be made faster by sorting that data, or something, but hey, |
# range. It could be made faster by sorting that data, or something, but hey, |
| 11 |
# it is only ever run once in a blue moon. |
# it is only ever run once in a blue moon. (It's even slower after I mended the |
| 12 |
|
# "forgot to check for script number before amalgamation" bug, but even so, |
| 13 |
|
# the effort of improving it isn't worth it.) |
| 14 |
|
|
| 15 |
# Subroutine: Given a character number, return the script number. The |
# Subroutine: Given a character number, return the script number. The |
| 16 |
# Scripts.txt file has been read into an array, keeping just the codepoints |
# Scripts.txt file has been read into an array, keeping just the codepoints |
| 166 |
} |
} |
| 167 |
|
|
| 168 |
else |
else |
| 169 |
{ |
{ |
| 170 |
|
my($startscript) = script($cp); |
| 171 |
my($ncp) = $cp + 1; |
my($ncp) = $cp + 1; |
| 172 |
while (<IN>) |
while (<IN>) |
| 173 |
{ |
{ |
| 175 |
last if (hex($fields[0]) != $ncp || |
last if (hex($fields[0]) != $ncp || |
| 176 |
$fields[2] ne $gc || |
$fields[2] ne $gc || |
| 177 |
$fields[12] ne "" || |
$fields[12] ne "" || |
| 178 |
$fields[13] ne ""); |
$fields[13] ne "" || |
| 179 |
|
script($ncp) != $startscript); |
| 180 |
|
|
| 181 |
$ncp++; |
$ncp++; |
| 182 |
} |
} |