[sword-cvs] sword/src/modules/filters gbfhtml.cpp,1.29,1.30 gbfhtmlhref.cpp,1.26,1.27 gbfrtf.cpp,1.35,1.36 gbfwebif.cpp,1.9,1.10 osisstrongs.cpp,1.9,1.10

sword@www.crosswire.org sword@www.crosswire.org
Fri, 30 Jan 2004 17:09:33 -0700


Update of /cvs/core/sword/src/modules/filters
In directory www:/tmp/cvs-serv30041/src/modules/filters

Modified Files:
	gbfhtml.cpp gbfhtmlhref.cpp gbfrtf.cpp gbfwebif.cpp 
	osisstrongs.cpp 
Log Message:
Updated for new strong: prefix and added some parsing logic for NASB


Index: gbfhtml.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/gbfhtml.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- gbfhtml.cpp	12 Aug 2003 05:36:30 -0000	1.29
+++ gbfhtml.cpp	31 Jan 2004 00:09:31 -0000	1.30
@@ -90,6 +90,19 @@
 							buf += *tok;
 					buf += "&gt;</em></small> ";					
 				}
+			} else {
+				num = strstr(token, "lemma=\"strong:");
+				if (num) {
+					for (num+=14; ((*num) && (*num != '\"')); num++)
+						*valto++ = *num;
+					*valto = 0;
+					if (atoi((!isdigit(*val))?val+1:val) < 5627) {
+						buf += " <small><em>&lt;";
+						for (tok = (!isdigit(*val))?val+1:val; *tok; tok++)
+								buf += *tok;
+						buf += "&gt;</em></small> ";					
+					}
+				}
 			}
 			valto = val;
 			num = strstr(token, "morph=\"x-Robinson:");

Index: gbfhtmlhref.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/gbfhtmlhref.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- gbfhtmlhref.cpp	24 Jan 2004 18:42:40 -0000	1.26
+++ gbfhtmlhref.cpp	31 Jan 2004 00:09:31 -0000	1.27
@@ -99,6 +99,32 @@
 				}
 				*/
 			}
+			else {
+				num = strstr(token, "lemma=\"strong:");
+				if (num) {
+					for (num+=14; ((*num) && (*num != '\"')); num++)
+						*valto++ = *num;
+					*valto = 0;
+					if (atoi((!isdigit(*val))?val+1:val) < 5627) {
+						buf += " <small><em>&lt;<a href=\"type=Strongs value=";
+						for (tok = val; *tok; tok++)
+								buf += *tok;
+						buf += "\">";
+						for (tok = (!isdigit(*val))?val+1:val; *tok; tok++)
+								buf += *tok;
+						buf += "</a>&gt;</em></small> ";
+						//cout << buf;
+						
+					}
+					/*	forget these for now
+					else {
+						// verb morph
+						sprintf(wordstr, "%03d", word-1);
+						module->getEntryAttributes()["Word"][wordstr]["Morph"] = val;
+					}
+					*/
+				}
+			}
 			valto = val;
 			num = strstr(token, "morph=\"x-Robinson:");
 			if (num) {

Index: gbfrtf.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/gbfrtf.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- gbfrtf.cpp	18 Sep 2003 02:21:32 -0000	1.35
+++ gbfrtf.cpp	31 Jan 2004 00:09:31 -0000	1.36
@@ -80,6 +80,28 @@
 					}
 					*/
 				}
+				else {
+					num = strstr(token, "lemma=\"strong:");
+					if (num) {
+						for (num+=14; ((*num) && (*num != '\"')); num++)
+							*valto++ = *num;
+						*valto = 0;
+						if (atoi((!isdigit(*val))?val+1:val) < 5627) {
+							// normal strongs number
+							strongnum += "{\\cf3 \\sub <";
+							for (tok = (!isdigit(*val))?val+1:val; *tok; tok++)
+								strongnum += *tok;
+							strongnum += ">}";
+						}
+						/*	forget these for now
+						else {
+							// verb morph
+							sprintf(wordstr, "%03d", word-1);
+							module->getEntryAttributes()["Word"][wordstr]["Morph"] = val;
+						}
+						*/
+					}
+				}
 				valto = val;
 				num = strstr(token, "morph=\"x-Robinson:");
 				if (num) {

Index: gbfwebif.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/gbfwebif.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- gbfwebif.cpp	18 Nov 2003 20:54:16 -0000	1.9
+++ gbfwebif.cpp	31 Jan 2004 00:09:31 -0000	1.10
@@ -39,7 +39,6 @@
 			// OSIS Word (temporary until OSISRTF is done)
 			valto = val;
 			num = strstr(token, "lemma=\"x-Strongs:");
-
 			if (num) {
 				for (num+=17; ((*num) && (*num != '\"')); num++)
 					*valto++ = *num;
@@ -61,6 +60,32 @@
 						buf += *tok;
 					}
 					buf += "</a>&gt;</em></small> ";
+				}
+			}
+			else {
+				num = strstr(token, "lemma=\"strong:");
+				if (num) {
+					for (num+=14; ((*num) && (*num != '\"')); num++)
+						*valto++ = *num;
+					*valto = 0;
+
+					if (atoi((!isdigit(*val))?val+1:val) < 5627) {
+						buf += " <small><em>&lt;";
+						url = "";
+						for (tok = val; *tok; tok++) {
+							url += *tok;
+						}
+						if ((url.length() > 1) && strchr("GH", url[0])) {
+							if (isdigit(url[1]))
+								url = url.c_str()+1;
+						}
+						buf.appendFormatted("<a href=\"%s?showStrong=%s#cv\">", passageStudyURL.c_str(), encodeURL(url).c_str());
+
+						for (tok = (!isdigit(*val))?val+1:val; *tok; tok++) {
+							buf += *tok;
+						}
+						buf += "</a>&gt;</em></small> ";
+					}
 				}
 			}
 			valto = val;

Index: osisstrongs.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/osisstrongs.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- osisstrongs.cpp	7 Jul 2003 01:16:15 -0000	1.9
+++ osisstrongs.cpp	31 Jan 2004 00:09:31 -0000	1.10
@@ -88,19 +88,39 @@
 							module->getEntryAttributes()["Word"][wordstr]["Morph"] = val;
 						}
 					}
+					else {
+						num = strstr(token, "lemma=\"strong:");
+						if (num) {
+							for (num+=14; ((*num) && (*num != '\"')); num++)
+								*valto++ = *num;
+							*valto = 0;
+							if (atoi((!isdigit(*val))?val+1:val) < 5627) {
+								// normal strongs number
+								sprintf(wordstr, "%03d", word++);
+								module->getEntryAttributes()["Word"][wordstr]["Strongs"] = val;
+								tmp = "";
+								tmp.append(text.c_str()+textStart, (int)(textEnd - textStart));
+								module->getEntryAttributes()["Word"][wordstr]["Text"] = tmp;
+								newText = true;
+							}
+							else {
+								// verb morph
+								sprintf(wordstr, "%03d", word-1);
+								module->getEntryAttributes()["Word"][wordstr]["Morph"] = val;
+							}
+						}
+					}
 				}
 				if (!option) {
 					char *num = strstr(token, "lemma=\"x-Strongs:");
 					if (num) {
 						memcpy(num, "savlm", 5);
-/*						
-						for (int i = 0; i < 17; i++)
-							*num++ = ' ';
-						for (; ((*num) && (*num!='\"')); num++)
-							*num = ' ';
-						if (*num)
-							*num = ' ';
-*/
+					}
+					else {
+						char *num = strstr(token, "lemma=\"strong:");
+						if (num) {
+							memcpy(num, "savlm", 5);
+						}
 					}
 				}
 			}