From: Jonathan Blake Date: Fri, 24 Mar 2006 00:26:50 +0000 (+0000) Subject: Updated for use with Spanish gamebooks and changed character entities to ... X-Git-Tag: 20121028~92 X-Git-Url: http://git.projectaon.org/?a=commitdiff_plain;h=f1623d036ac32a9d5c953c64d074583952b68d17;p=project-aon.git Updated for use with Spanish gamebooks and changed character entities to tags. git-svn-id: https://projectaon.org/data/trunk@141 f6f3e2d7-ff33-0410-aaf5-b4bee2cdac11 --- diff --git a/scripts/gbfixencoding.pl b/scripts/gbfixencoding.pl index d6d91c5..e12c290 100755 --- a/scripts/gbfixencoding.pl +++ b/scripts/gbfixencoding.pl @@ -50,19 +50,19 @@ sub encodify { my $modified = $line; my $replacements = 0; - if( $modified =~ s{ ([[:space:]]) \& ([[:space:]]) }{$1\&ersand;$2}xg ) { $replacements = 1; } - if( $modified =~ s{ [[:space:]]+ - [[:space:]]+ }{\&emdash;}xg ) { $replacements = 1; } - if( $modified =~ s{ (?) }{$1\&emdash;$2}xg ) { $replacements = 1; } - if( $modified =~ s{ [[:space:]]* \227 [[:space:]]* }{\&emdash;}xg ) { $replacements = 1; } - if( $modified =~ s{ ([[:digit:]]) - ([[:digit:]]) }{$1\&endash;$2}xg ) { $replacements = 1; } - if( $modified =~ s{ [[:space:]]* \227 [[:space:]]* }{\&endash;}xg ) { $replacements = 1; } - if( $modified =~ s{ > [[:space:]]* \. [[:space:]]* \. ([[:space:]]* \.)? }{>\&lellips;}xg ) { $replacements = 1; } - if( $modified =~ s{ [[:space:]]* \. [[:space:]]* \. ([[:space:]]* \.)? }{\&ellips;}xg ) { $replacements = 1; } - if( $modified =~ s{ () \1 }{\&thinspace;}xg ) { $replacements = 1; } - if( $modified =~ s{ \' }{\&thinspace;\'}xg ) { $replacements = 1; } - if( $modified =~ s{ \' }{\'\&thinspace;}xg ) { $replacements = 1; } - if( $modified =~ s{ __+ }{\&blankline;}xg ) { $replacements = 1; } - if( $modified =~ s{\%}{\&percent;}xg ) { $replacements = 1; } + if( $modified =~ s{ ([[:space:]]) \& ([[:space:]]) }{$1$2}xg ) { $replacements = 1; } + if( $modified =~ s{ [[:space:]]+ - [[:space:]]+ }{}xg ) { $replacements = 1; } + if( $modified =~ s{ (?) }{$1$2}xg ) { $replacements = 1; } + if( $modified =~ s{ [[:space:]]* \227 [[:space:]]* }{}xg ) { $replacements = 1; } + if( $modified =~ s{ ([[:digit:]]) - ([[:digit:]]) }{$1$2}xg ) { $replacements = 1; } + if( $modified =~ s{ [[:space:]]* \227 [[:space:]]* }{}xg ) { $replacements = 1; } + if( $modified =~ s{ > [[:space:]]* \. [[:space:]]* \. ([[:space:]]* \.)? }{>}xg ) { $replacements = 1; } + if( $modified =~ s{ [[:space:]]* \. [[:space:]]* \. ([[:space:]]* \.)? }{}xg ) { $replacements = 1; } + if( $modified =~ s{ () \1 }{}xg ) { $replacements = 1; } + if( $modified =~ s{ \' }{}xg ) { $replacements = 1; } + if( $modified =~ s{ \' }{}xg ) { $replacements = 1; } + if( $modified =~ s{ __+ }{}xg ) { $replacements = 1; } + if( $modified =~ s{\%}{}xg ) { $replacements = 1; } if( $replacements ) { print "\033[2J"; @@ -96,26 +96,26 @@ sub highlight { $text =~ s{^[[:space:]]+}{}g; $text =~ s{ ([[:space:]]) \& ([[:space:]]) }{$1$start\&$stop$2}xg; - $text =~ s{(\&ersand;)}{$encodedStart$1$stop}g; - $text =~ s{(\&emdash;)}{$encodedDashStart$1$stop}g; + $text =~ s{()}{$encodedStart$1$stop}g; + $text =~ s{()}{$encodedDashStart$1$stop}g; $text =~ s{ [[:space:]] (\&) [[:space:]] }{$dashStart$1$stop}xg; $text =~ s{ ([[:space:]]+ - [[:space:]]+) }{$dashStart$1$stop}xg; $text =~ s{ (?)}{$encodedDashStart$1$stop}g; $text =~ s{ ([[:digit:]]) - ([[:digit:]]) }{$1$dashStart-$stop$2}xg; $text =~ s{ ([[:space:]]* \226 [[:space:]]*) }{$dashStart$1$stop}xg; - $text =~ s{(\&lellips;)}{$encodedStart$1$stop}g; + $text =~ s{()}{$encodedStart$1$stop}g; $text =~ s{ > ([[:space:]]* \. [[:space:]]* \. ([[:space:]]* \.)?) }{>$start$1$stop}xg; - $text =~ s{(\&ellips;)}{$encodedStart$1$stop}g; + $text =~ s{()}{$encodedStart$1$stop}g; $text =~ s{ ([[:space:]]* \. [[:space:]]* \. ([[:space:]]* \.)?) }{$start$1$stop}xg; - $text =~ s{(\&thinspace;)}{$encodedStart$1$stop}g; + $text =~ s{()}{$encodedStart$1$stop}g; $text =~ s{ ( \1) }{$start$1$stop}xg; - $text =~ s{ ( \') }{$start$1$stop}xg; - $text =~ s{ (\' ) }{$start$1$stop}xg; - $text =~ s{(\&blankline;)}{$encodedStart$1$stop}g; + $text =~ s{ ( ) }{$start$1$stop}xg; + $text =~ s{ ( ) }{$start$1$stop}xg; + $text =~ s{()}{$encodedStart$1$stop}g; $text =~ s{ (__+) }{$start$1$stop}xg; - $text =~ s{(\&percent;)}{$encodedStart$1$stop}g; + $text =~ s{()}{$encodedStart$1$stop}g; $text =~ s{(\%)}{$start$1$stop}xg; return $text;