[sword-svn] r2281 - in trunk: . examples/cmdline src/modules/filters utilities

scribe at crosswire.org scribe at crosswire.org
Mon Mar 9 16:11:25 MST 2009


Author: scribe
Date: 2009-03-09 16:11:25 -0700 (Mon, 09 Mar 2009)
New Revision: 2281

Modified:
   trunk/configure.ac
   trunk/examples/cmdline/lookup.cpp
   trunk/examples/cmdline/outplain.cpp
   trunk/examples/cmdline/outrender.cpp
   trunk/src/modules/filters/osisstrongs.cpp
   trunk/src/modules/filters/osiswordjs.cpp
   trunk/utilities/imp2vs.cpp
Log:
Added -Werror on debug builds
Added page support for Tregelles



Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2009-03-07 15:34:36 UTC (rev 2280)
+++ trunk/configure.ac	2009-03-09 23:11:25 UTC (rev 2281)
@@ -80,14 +80,14 @@
 if test x$enable_debug = xyes; then
   GCJFLAGS="-g -O0"
   if test x$ac_cv_prog_cc_g = xyes; then
-    AM_CFLAGS="-g3 -O0 -Wall"
+    AM_CFLAGS="-g3 -O0 -Wall -Werror"
   else
-    AM_CFLAGS="-O0 -Wall"
+    AM_CFLAGS="-O0 -Wall -Werror"
   fi
   if test x$ac_cv_prog_cxx_g = xyes; then
-    AM_CXXFLAGS="-g3 -O0 -Wall"
+    AM_CXXFLAGS="-g3 -O0 -Wall -Werror"
   else
-    AM_CXXFLAGS="-O0 -Wall"
+    AM_CXXFLAGS="-O0 -Wall -Werror"
   fi
 else
   AM_CFLAGS="-O3"

Modified: trunk/examples/cmdline/lookup.cpp
===================================================================
--- trunk/examples/cmdline/lookup.cpp	2009-03-07 15:34:36 UTC (rev 2280)
+++ trunk/examples/cmdline/lookup.cpp	2009-03-09 23:11:25 UTC (rev 2281)
@@ -19,8 +19,8 @@
 int main(int argc, char **argv)
 {
 	
-//	SWMgr manager(new MarkupFilterMgr(FMT_WEBIF));
-	SWMgr manager(new MarkupFilterMgr(FMT_HTMLHREF));
+	SWMgr manager(new MarkupFilterMgr(FMT_WEBIF));
+//	SWMgr manager(new MarkupFilterMgr(FMT_HTMLHREF));
 	SWModule *target;
 
 	if (argc != 3) {

Modified: trunk/examples/cmdline/outplain.cpp
===================================================================
--- trunk/examples/cmdline/outplain.cpp	2009-03-07 15:34:36 UTC (rev 2280)
+++ trunk/examples/cmdline/outplain.cpp	2009-03-09 23:11:25 UTC (rev 2281)
@@ -36,9 +36,8 @@
 	if (!book.getRawEntryBuf().size()) return -2; 	// empty module
 	for (;!book.Error(); book++) {
 		cout << "$$$";
-//		if (vk) cout << vk->getOSISRef();
-//		else
-			cout << book.getKeyText();
+		if (vk) cout << vk->getOSISRef();
+		else    cout << book.getKeyText();
 		cout << "\n" << book.RenderText() << "\n\n";
 	}
 }

Modified: trunk/examples/cmdline/outrender.cpp
===================================================================
--- trunk/examples/cmdline/outrender.cpp	2009-03-07 15:34:36 UTC (rev 2280)
+++ trunk/examples/cmdline/outrender.cpp	2009-03-09 23:11:25 UTC (rev 2281)
@@ -36,9 +36,8 @@
 	if (!book.getRawEntryBuf().size()) return -2; 	// empty module
 	for (;!book.Error(); book++) {
 		cout << "$$$";
-//		if (vk) cout << vk->getOSISRef();
-//		else
-			cout << book.getKeyText();
+		if (vk) cout << vk->getOSISRef();
+		else    cout << book.getKeyText();
 		cout << "\n" << book.RenderText() << "\n\n";
 	}
 }

Modified: trunk/src/modules/filters/osisstrongs.cpp
===================================================================
--- trunk/src/modules/filters/osisstrongs.cpp	2009-03-07 15:34:36 UTC (rev 2280)
+++ trunk/src/modules/filters/osisstrongs.cpp	2009-03-09 23:11:25 UTC (rev 2281)
@@ -53,6 +53,7 @@
 	int wordNum = 1;
 	char wordstr[5];
 	const char *wordStart = 0;
+	SWBuf page = "";		// some modules include <seg> page info, so we add these to the words
 
 	const SWBuf orig = text;
 	const char * from = orig.c_str();
@@ -65,6 +66,20 @@
 		}
 		if (*from == '>') {	// process tokens
 			intoken = false;
+
+			// possible page seg --------------------------------
+			if (token.startsWith("seg ")) {
+				XMLTag stag(token);
+				SWBuf type = stag.getAttribute("type");
+				if (type == "page") {
+					SWBuf number = stag.getAttribute("subtype");
+					if (number.length()) {
+						page = number;
+					}
+				}
+			}
+			// ---------------------------------------------------
+
 			if (token.startsWith("w ")) {	// Word
 				XMLTag wtag(token);
 				if (module->isProcessEntryAttributes()) {
@@ -182,15 +197,17 @@
 
 
 					if (lemma.length())
-					module->getEntryAttributes()["Word"][wordstr]["Lemma"] = lemma;
+						module->getEntryAttributes()["Word"][wordstr]["Lemma"] = lemma;
 					if (lemmaClass.length())
-					module->getEntryAttributes()["Word"][wordstr]["LemmaClass"] = lemmaClass;
+						module->getEntryAttributes()["Word"][wordstr]["LemmaClass"] = lemmaClass;
 					if (morph.length())
-					module->getEntryAttributes()["Word"][wordstr]["Morph"] = morph;
+						module->getEntryAttributes()["Word"][wordstr]["Morph"] = morph;
 					if (morphClass.length())
-					module->getEntryAttributes()["Word"][wordstr]["MorphClass"] = morphClass;
+						module->getEntryAttributes()["Word"][wordstr]["MorphClass"] = morphClass;
 					if (src.length())
 						module->getEntryAttributes()["Word"][wordstr]["Src"] = src;
+					if (page.length())
+						module->getEntryAttributes()["Word"][wordstr]["Page"] = page;
 
 					if (wtag.isEmpty()) {
 						int j;

Modified: trunk/src/modules/filters/osiswordjs.cpp
===================================================================
--- trunk/src/modules/filters/osiswordjs.cpp	2009-03-07 15:34:36 UTC (rev 2280)
+++ trunk/src/modules/filters/osiswordjs.cpp	2009-03-09 23:11:25 UTC (rev 2281)
@@ -91,8 +91,11 @@
 					SWBuf lemmaClass;
 					SWBuf lemma;
 					SWBuf morph;
+					SWBuf page;
 					SWBuf src;
 					char gh = 0;
+					page = module->getEntryAttributes()["Word"][wordstr]["Page"].c_str();
+					if (page.length()) page = (SWBuf)"p:" + page;
 					int count = atoi(module->getEntryAttributes()["Word"][wordstr]["PartCount"].c_str());
 					for (int i = 0; i < count; i++) {
 
@@ -161,7 +164,7 @@
 						}
 					}
 					// 'p' = 'fillpop' to save bandwidth
-					text.appendFormatted("<span class=\"clk\" onclick=\"p('%s','%s','%s','%s','','%s');\" >", lexName.c_str(), lemma.c_str(), wordID.c_str(), morph.c_str(), modName.c_str());
+					text.appendFormatted("<span class=\"clk\" onclick=\"p('%s','%s','%s','%s','%s','%s');\" >", lexName.c_str(), lemma.c_str(), wordID.c_str(), morph.c_str(), page.c_str(), modName.c_str());
 					wordNum++;
 				}
 				if ((*token == '/') && (token[1] == 'w') && option) {	// Word

Modified: trunk/utilities/imp2vs.cpp
===================================================================
--- trunk/utilities/imp2vs.cpp	2009-03-07 15:34:36 UTC (rev 2280)
+++ trunk/utilities/imp2vs.cpp	2009-03-09 23:11:25 UTC (rev 2281)
@@ -129,6 +129,7 @@
 
 
 
+int page = 0;
 
 
 void writeEntry(const SWBuf &key, const SWBuf &entry, SWModule *module)
@@ -147,6 +148,38 @@
 				*linkMaster = *vkey;
 				SWBuf text = module->getRawEntry();
 				text += entry;
+
+
+				//------------------------------------------------------------
+				//  Tregelles Page marking special stuff
+				//------------------------------------------------------------
+/*
+				const char *pageMarker = "<seg type=\"page\" subtype=\"";
+				int newPage = page;
+				SWBuf pageData = strstr(text.c_str(), pageMarker);
+				if (pageData.length()) {
+					pageData << strlen(pageMarker);
+					const char *pn = pageData.stripPrefix('"');
+					if (pn) newPage = atoi(pn);
+				}
+				// add page stuff for treg
+				if (text.startsWith(pageMarker)) {
+					// don't add anything cuz we already start with one
+				}
+				else {
+					SWBuf pm = pageMarker;
+					pm.appendFormatted("%d\" />", page);
+					text = pm + text;
+				}
+
+				page = newPage;	// when our line set a new page number
+
+*/
+				//------------------------------------------------------------
+
+
+
+
 				std::cout << "adding entry: " << *vkey << " length " << entry.size() << "/" << (unsigned short)text.size() << std::endl;
 				module->setEntry(text);
 				first = false;




More information about the sword-cvs mailing list