From ebfefbb60f308280e3c6b8e8aa0af7861f2c3746 Mon Sep 17 00:00:00 2001 From: imiyazaki Date: Thu, 5 Feb 2004 13:05:14 +0000 Subject: [PATCH] fix handling of TeX metacharacter. make `` and ` compatible to TeX. --- inCHISE | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/inCHISE b/inCHISE index cfdf098..6bd683b 100755 --- a/inCHISE +++ b/inCHISE @@ -185,8 +185,10 @@ while(<>){ s/([^$asian$idc])\s*([$asian])/$1 $2/go; s/\-\-\-/pack("U",0x2014)/geo;# EM DASH s/\-\-/pack("U",0x2013)/geo;# EN DASH - s/\`\`/pack("U",0x201f)/geo;# DOUBLE HIGH-REVERSED-9 QUOTATION MARK - s/\`/pack("U",0x201b)/geo;# SINGLE HIGH-REVERSED-9 QUOTATION MARK +# s/\`\`/pack("U",0x201f)/geo;# DOUBLE HIGH-REVERSED-9 QUOTATION MARK + s/\`\`/pack("U",0x201c)/geo;# _TeX compatible_ +# s/\`/pack("U",0x201b)/geo;# SINGLE HIGH-REVERSED-9 QUOTATION MARK + s/\`/pack("U",0x2018)/geo;# _TeX compatible_ s/\'\'/pack("U",0x201d)/geo;# RIGHT DOUBLE QUOTATION MARK s/\'/pack("U",0x2019)/geo;# RIGHT DOUBLE QUOTATION MARK @chars=split(//); @@ -217,9 +219,6 @@ while(<>){ } } next CHAR; - }elsif($char=~m/($tex_meta_re)/o){ - print $tex_meta{$1}; - next CHAR; }elsif(($char_id>0x20 and $char_id<=0x021f) # Basic Latin # Latin-1 Supplement @@ -382,7 +381,9 @@ sub latin_parse{ my $out_str=""; while($i<=$#chars){ $char_id=unpack("U",$chars[$i]); - if(($char_id>0x20 and $char_id<=0x021f) + if($chars[$i]=~m/($tex_meta_re)/o){ + $out_str.=$tex_meta{$chars[$i]}; + }elsif(($char_id>0x20 and $char_id<=0x021f) or($char_id>=0x0250 and $char_id<=0x02af)# IPA Extensions or($char_id>=0x0300 and $char_id<=0x033f)# Combining Diacritical Marks or($char_id>=0x0360 and $char_id<=0x036f) -- 1.7.10.4