[sword-svn] r241 - trunk/source/data/translit/crosswire

chrislit at crosswire.org chrislit at crosswire.org
Sun Nov 10 03:39:26 MST 2013


Author: chrislit
Date: 2013-11-10 03:39:25 -0700 (Sun, 10 Nov 2013)
New Revision: 241

Modified:
   trunk/source/data/translit/crosswire/icu2cldr.pl
Log:
retain more comment data when going from ICU to CLDR

Modified: trunk/source/data/translit/crosswire/icu2cldr.pl
===================================================================
--- trunk/source/data/translit/crosswire/icu2cldr.pl	2013-11-09 23:17:36 UTC (rev 240)
+++ trunk/source/data/translit/crosswire/icu2cldr.pl	2013-11-10 10:39:25 UTC (rev 241)
@@ -9,14 +9,12 @@
 
 foreach $file (@xlits) {
 
-    my $barCount = 0;
-
     open (INF, "<:encoding(utf8)", $file);
     $file =~ s/\.txt$/.xml/;
     $file =~ s/\_/\-/g;
     open (OUTF, ">:encoding(utf8)", "cldr/$file");
     
-    print OUTF "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE supplementalData SYSTEM \"../../common/dtd/ldmlSupplemental.dtd\">\n<!--\nCopyright © 2013 Unicode, Inc.\nCLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)\nFor terms of use, see http://www.unicode.org/copyright.html\n-->\n<supplementalData>\n	<version number=\"\$Revision: \$\"/>\n	<generation date=\"\$Date: \$\"/>\n	<transforms>\n";
+    print OUTF "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE supplementalData SYSTEM \"../../common/dtd/ldmlSupplemental.dtd\">\n<!--\nCopyright © 1991-2013 Unicode, Inc.\nCLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)\nFor terms of use, see http://www.unicode.org/copyright.html\n-->\n<supplementalData>\n	<version number=\"\$Revision\$\"/>\n	<generation date=\"\$Date\$\"/>\n	<transforms>\n";
 
     $file =~ /^(.+?)\-(.+?)(\-(.+?))?\./;
     my $source = $1;
@@ -50,18 +48,21 @@
 	    $line = NFD($line);
 
 	    if ($line =~ /^\#/) {
-		if ($barCount > 1) {
+		if ($line =~ /^\# \*\s*$/) {} #temporary; remove when CLDR data is in good shape
+		elsif ($line =~ /^\# (File:|Generated from CLDR)/) {}
+		elsif ($line =~ /^\#[\s\-]*$/) {} #temporary; remove when CLDR data is in good shape
+		else {
 		    print OUTF "			<comment>$line<\/comment>\n";
 		}
-		if ($line =~ /^#-------------------+/) {
-		    $barCount += 1;
-		}
 	    }
 	    else {
-		$line =~ s/\\u([0-9A-Fa-f]{1,6})/chr(hex($1))/eg;
+		# Disabling this line; re-enable as necessary;; $line =~ s/\\u([0-9A-Fa-f]{1,6})/chr(hex($1))/eg;
 		print OUTF "			<tRule>$line<\/tRule>\n";
 	    }
 	}
+	else {
+	    print OUTF "\n";
+	}
     }
 
     print OUTF "		</transform>\n	</transforms>\n</supplementalData>\n";




More information about the sword-cvs mailing list