[sword-svn] r3740 - trunk/src/mgr

scribe at crosswire.org scribe at crosswire.org
Sun May 10 10:45:54 MST 2020


Author: scribe
Date: 2020-05-10 10:45:54 -0700 (Sun, 10 May 2020)
New Revision: 3740

Modified:
   trunk/src/mgr/versificationmgr.cpp
Log:
av11n mappings Fix Synodal Dan 1 been mapped to Dan. Patch from ?\208?\154?\208?\190?\209?\129?\209?\130?\209?\143 ?\208?\156?\208?\176?\209?\129?\208?\187?\209?\142?\208?\186 <kostyamaslyuk at gmail.com>


Modified: trunk/src/mgr/versificationmgr.cpp
===================================================================
--- trunk/src/mgr/versificationmgr.cpp	2020-05-10 17:40:17 UTC (rev 3739)
+++ trunk/src/mgr/versificationmgr.cpp	2020-05-10 17:45:54 UTC (rev 3740)
@@ -93,14 +93,17 @@
 		verse of another chapter in default intermediate canon(kjva), so mapping data
 		contains expections. Intermediate canon could not contain corresponding data.
 		
-		pointers on uchar[7]: 1 value - book id 1-based, ot+nt, 2-4 map to, 5-7 map
-		from (chap,verse from, verse to if greater then "verse from")
-		
-		TODO what if book name in one v11n differs from cannon
-			special section in mapping for book transformation
+		Each element in @variable mappings contains of all rules that are related to
+		particular book.
+
+		@typedef mappingRule is a pointer on uchar[7]: 1 value - book id 1-based, ot+nt,
+		2-4 map to, 5-7 map from (chap,verse from, verse to if greater then "verse from").
+		Size of rule would be 8 if there is inter-book mapping and target book is abscent
+		in reference system, in this case @variable mappingsExtraBooks data is used and
+		id is rule book id minus book count.
 	*/
-	typedef vector<const unsigned char*> mapping;
-	vector<mapping> mappings;
+	typedef vector<const unsigned char*> mappingRule;
+	vector<mappingRule> mappings;
 	vector<const char*> mappingsExtraBooks;
 
 	Private() {
@@ -463,6 +466,9 @@
 		// reversed mapping should use forward search for item
 		for (unsigned int i=0; i<dstSys->p->mappings[b].size(); ++i) {
 			const unsigned char *m = dstSys->p->mappings[b][i];
+
+			if (m[0] != b+1) continue; // filter inter-book rules
+
 			if (m[4] == *chapter && m[5] <= *verse) {
 				//dbg_mapping SWLog::getSystemLog()->logDebug("found mapping %i %i %i %i %i %i\n",m[1],m[2],m[3],m[4],m[5],m[6]);
 				if (m[5] == *verse || (m[6] >= *verse && m[5] <= *verse)) {




More information about the sword-cvs mailing list