[sword-svn] r2476 - in trunk: src/keys tests/testsuite

scribe at crosswire.org scribe at crosswire.org
Wed Nov 18 00:43:01 MST 2009


Author: scribe
Date: 2009-11-18 00:43:01 -0700 (Wed, 18 Nov 2009)
New Revision: 2476

Modified:
   trunk/src/keys/versekey.cpp
   trunk/tests/testsuite/verseparsing.good
   trunk/tests/testsuite/verseparsing.sh
Log:
added parsing jn.1.1,5f


Modified: trunk/src/keys/versekey.cpp
===================================================================
--- trunk/src/keys/versekey.cpp	2009-11-18 06:29:35 UTC (rev 2475)
+++ trunk/src/keys/versekey.cpp	2009-11-18 07:43:01 UTC (rev 2476)
@@ -644,6 +644,9 @@
 //				if (comma) {
 					curKey->Chapter(lastKey->Chapter());
 					curKey->Verse(chap);  // chap because this is the first number captured
+					if (suffix) {
+						curKey->setSuffix(suffix);
+					}
 				}
 				else {
 					if (useChapterAsVerse && verse < 0 && chap > 0 && curKey->getChapterMax() == 1) {
@@ -770,7 +773,8 @@
 					break;
 				default:
 					// suffixes (and oddly 'f'-- ff.)
-					if ((*buf >= 'a' && *buf <= 'z') && (chap >=0)) {
+					if (((*buf >= 'a' && *buf <= 'z') && (chap >=0)) || *buf == 'f') {
+						// if suffix is already an 'f', then we need to mark if we're doubleF.
 						doubleF = (*buf == 'f' && suffix == 'f');
 						suffix = *buf;
 					}
@@ -863,6 +867,9 @@
 		if (((comma)||((verse < 0)&&(bookno < 0)))&&(!lastPartial)) {
 			curKey->Chapter(lastKey->Chapter());
 			curKey->Verse(chap);  // chap because this is the first number captured
+			if (suffix) {
+				curKey->setSuffix(suffix);
+			}
 		}
 		else {
 			if (useChapterAsVerse && verse < 0 && chap > 0 && curKey->getChapterMax() == 1) {

Modified: trunk/tests/testsuite/verseparsing.good
===================================================================
--- trunk/tests/testsuite/verseparsing.good	2009-11-18 06:29:35 UTC (rev 2475)
+++ trunk/tests/testsuite/verseparsing.good	2009-11-18 07:43:01 UTC (rev 2476)
@@ -53,6 +53,8 @@
 1Jn 1:1; 3:10: I John 1:1; I John 3:10
 1Jn 1:1 ;3:10: I John 1:1; I John 3:10
 1Jn 1:1 ; 3:10: I John 1:1; I John 3:10
+1Jn1.1f ; 3:10ff: I John 1:1-I John 1:2; I John 3:10-I John 3:24
+1Jn1.1ff ; 3:10f: I John 1:1-I John 1:10; I John 3:10-I John 3:11
 Gen: Genesis 1:1-Genesis 50:26
 Genes: Genesis 1:1-Genesis 50:26
 Exod: Exodus 1:1-Exodus 40:38

Modified: trunk/tests/testsuite/verseparsing.sh
===================================================================
--- trunk/tests/testsuite/verseparsing.sh	2009-11-18 06:29:35 UTC (rev 2475)
+++ trunk/tests/testsuite/verseparsing.sh	2009-11-18 07:43:01 UTC (rev 2476)
@@ -80,6 +80,8 @@
 ../parsekey "1Jn 1:1; 3:10"
 ../parsekey "1Jn 1:1 ;3:10"
 ../parsekey "1Jn 1:1 ; 3:10"
+../parsekey "1Jn1.1f ; 3:10ff"
+../parsekey "1Jn1.1ff ; 3:10f"
 
 en_abbrevs="
 Gen Genes Exod Ex Exo Lev Le Levi Num Nu Numb Deut Deu De Josh Jos Joshu




More information about the sword-cvs mailing list