[sword-svn] r340 - trunk/modules/perlconverters

chrislit at crosswire.org chrislit at crosswire.org
Sun Jan 1 18:13:43 MST 2012


Author: chrislit
Date: 2012-01-01 18:13:43 -0700 (Sun, 01 Jan 2012)
New Revision: 340

Modified:
   trunk/modules/perlconverters/usfm2osis.pl
Log:
added support for \wj (Words of Jesus) and enumerated \ms# (Major Section) tags

Modified: trunk/modules/perlconverters/usfm2osis.pl
===================================================================
--- trunk/modules/perlconverters/usfm2osis.pl	2011-12-09 20:16:21 UTC (rev 339)
+++ trunk/modules/perlconverters/usfm2osis.pl	2012-01-02 01:13:43 UTC (rev 340)
@@ -4,7 +4,7 @@
 
 ## Licensed under the standard BSD license:
 
-# Copyright (c) 2002-2011 CrossWire Bible Society <http://www.crosswire.org/>
+# Copyright (c) 2002-2012 CrossWire Bible Society <http://www.crosswire.org/>
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -425,12 +425,12 @@
 	#### Markers Not Yet Supported: \mte#, \mr, \sr 
 
 	# \ms majorSection
-	if ($line =~ /^\\ms\b\s*(.+)/) {
+	if ($line =~ /^\\ms\d?\b\s*(.+)/) {
 	    push (@outdata, closeTag("<\/p>"));
 	    push (@outdata, closeTag("<\/div type=\"majorSection\">"));
 	    push (@outdata, "<div type=\"majorSection\">\n");
 	    openTag("<\/div type=\"majorSection\">");
-	    $line =~ s/\\ms\b\s*(.+)/<title>$1<\/title>/;
+	    $line =~ s/\\ms\d?\b\s*(.+)/<title>$1<\/title>/;
 	}
 	# \d canonical title
 	if ($line =~ /^\\d\b\s*(.+)?(\\d\*)?/) {
@@ -890,8 +890,8 @@
 	$line =~ s/<reference osisRef="([^\.\"]+)\.(\d+)\.([^\"]+)">([^<]+)<\/reference>, <reference osisRef="(\d+)"/<reference osisRef="$1\.$2\.$3">$4<\/reference>, <reference osisRef="$1\.$2\.$5"/g; # Gen. 1:1, 3
 	$line =~ s/<reference osisRef="([^\"\.]+)\.(\d+)"/<reference osisRef="$1\.1\.$2"/g; # Jude 1
 
-	### Special Text and Character Styles--Markers Supported: \it...\it*, \nd...\nd*, \pn...\pn*, \tl...\tl*, \qt...\qt*, \add...\add*, \pb, \bk...\bk*, \sc..\sc*, \bd...\bd*
-	#### Markers Not Yet Supported: Special Text:  \k...\k*, \lit, \ord...\ord*, \sig...\sig*, \wj...\wj*; Character Styling: \em...\em*,  \bdit...\bdit*, \no...\no*; Spacing and Breaks: !$, //; Special Features: \fig...\fig*, \ndx...\ndx*, \pro...\pro*, \w...\w*, \wg...\wg*, \wh...\wh*
+	### Special Text and Character Styles--Markers Supported: \it...\it*, \nd...\nd*, \pn...\pn*, \tl...\tl*, \qt...\qt*, \add...\add*, \pb, \bk...\bk*, \sc..\sc*, \bd...\bd*, \wj...\wj*
+	#### Markers Not Yet Supported: Special Text:  \k...\k*, \lit, \ord...\ord*, \sig...\sig*,; Character Styling: \em...\em*,  \bdit...\bdit*, \no...\no*; Spacing and Breaks: !$, //; Special Features: \fig...\fig*, \ndx...\ndx*, \pro...\pro*, \w...\w*, \wg...\wg*, \wh...\wh*
 
 	# \dc...\dc*, inserted deuterocanonical text
 	$line =~ s/\\dc\b\s*(.*?)\\dc\*/<transChange type=\"added\" editions=\"dc\">$1<\/transChange>/g;
@@ -923,6 +923,9 @@
 	# \add...\add*, text added for translation purposes
 	$line =~ s/\\add\b\s*(.*?)\\add\*/<transChange type=\"added\">$1<\/transChange>/g;
 
+	# \wj...\wj*, Words of Jesus
+	$line =~ s/\\wj\b\s*(.*?)\\wj\*/<q who="Jesus" marker="">$1<\/q>/g;
+
 	# \pb, page break
 	$line =~ s/\\pb\b/<milestone type=\"pb\"\/>/g;
 




More information about the sword-cvs mailing list