[sword-svn] r1919 - in trunk: bindings/corba/orbitcpp src/modules utilities

scribe at crosswire.org scribe at crosswire.org
Mon May 22 00:55:49 MST 2006


Author: scribe
Date: 2006-05-22 00:55:43 -0700 (Mon, 22 May 2006)
New Revision: 1919

Modified:
   trunk/bindings/corba/orbitcpp/testclient.cpp
   trunk/bindings/corba/orbitcpp/webmgr.hpp
   trunk/src/modules/swmodule.cpp
   trunk/utilities/mkfastmod.cpp
Log:
Fixed lucene buffer building
Fixed ThML web word parsing that broke a couple commits ago
Added banner to show percent heading to mkfastmod


Modified: trunk/bindings/corba/orbitcpp/testclient.cpp
===================================================================
--- trunk/bindings/corba/orbitcpp/testclient.cpp	2006-05-22 02:16:43 UTC (rev 1918)
+++ trunk/bindings/corba/orbitcpp/testclient.cpp	2006-05-22 07:55:43 UTC (rev 1919)
@@ -52,7 +52,7 @@
 		mgr->setJavascript(true);
 		mgr->setGlobalOption("Textual Variants", "Secondary Reading");
 		mgr->setGlobalOption("Footnotes", "On");
-		module = mgr->getModuleByName("KJV2006");
+		module = mgr->getModuleByName("TR");
 /*
 		module->setKeyText("jas.1.19");
 		swordorb::StringList *attr = module->getEntryAttribute("Footnote", "", "body", true);

Modified: trunk/bindings/corba/orbitcpp/webmgr.hpp
===================================================================
--- trunk/bindings/corba/orbitcpp/webmgr.hpp	2006-05-22 02:16:43 UTC (rev 1918)
+++ trunk/bindings/corba/orbitcpp/webmgr.hpp	2006-05-22 07:55:43 UTC (rev 1919)
@@ -48,8 +48,16 @@
 
 
 	void AddGlobalOptions(SWModule *module, ConfigEntMap &section, ConfigEntMap::iterator start, ConfigEntMap::iterator end) {
+
+		// ThML word stuff needs to process before strongs strip
+		if (module->Markup() == FMT_THML) {
+			module->AddOptionFilter(thmlWordJS);
+		}
+
+		// add other module filters
 		SWMgr::AddGlobalOptions(module, section, start, end);
 
+		// add our special filters
 		if (module->getConfig().has("Feature", "GreekDef")) {
 			defaultGreekLex = module;
 		}
@@ -72,9 +80,6 @@
 		if (module->Markup() == FMT_OSIS) {
 			module->AddOptionFilter(osisWordJS);
 		}
-		if (module->Markup() == FMT_THML) {
-			module->AddOptionFilter(thmlWordJS);
-		}
 		if (module->Markup() == FMT_GBF) {
 			module->AddOptionFilter(gbfWordJS);
 		}

Modified: trunk/src/modules/swmodule.cpp
===================================================================
--- trunk/src/modules/swmodule.cpp	2006-05-22 02:16:43 UTC (rev 1918)
+++ trunk/src/modules/swmodule.cpp	2006-05-22 07:55:43 UTC (rev 1919)
@@ -1040,18 +1040,25 @@
 			AttributeList::iterator word;
 			AttributeValue::iterator strongVal;
 
+			strong="";
 			words = getEntryAttributes().find("Word");
 			if (words != getEntryAttributes().end()) {
 				for (word = words->second.begin();word != words->second.end(); word++) {
-					strongVal = word->second.find("Lemma");
-					if (strongVal != word->second.end()) {
-						// cheeze.  skip empty article tags that weren't assigned to any text
-						if (strongVal->second == "G3588") {
-							if (word->second.find("Text") == word->second.end())
-								continue;	// no text? let's skip
+					int partCount = atoi(word->second["PartCount"]);
+					if (!partCount) partCount = 1;
+					for (int i = 0; i < partCount; i++) {
+						SWBuf tmp = "Lemma";
+						if (partCount > 1) tmp.appendFormatted(".%d", i+1);
+						strongVal = word->second.find(tmp);
+						if (strongVal != word->second.end()) {
+							// cheeze.  skip empty article tags that weren't assigned to any text
+							if (strongVal->second == "G3588") {
+								if (word->second.find("Text") == word->second.end())
+									continue;	// no text? let's skip
+							}
+							strong.append(strongVal->second);
+							strong.append(' ');
 						}
-						strong.append(strongVal->second);
-						strong.append(' ');
 					}
 				}
 			}
@@ -1084,35 +1091,41 @@
 //printf("building proxBuf from (%s).\nproxBuf.c_str(): %s\n", (const char *)*key, proxBuf.c_str());
 //printf("building proxBuf from (%s).\n", (const char *)*key);
 
-					// build "strong" field
-					strong = "";
-					AttributeTypeList::iterator words;
-					AttributeList::iterator word;
-					AttributeValue::iterator strongVal;
+					content = StripText();
+					if (content && *content) {
+						// build "strong" field
+						strong = "";
+						AttributeTypeList::iterator words;
+						AttributeList::iterator word;
+						AttributeValue::iterator strongVal;
 
-					words = getEntryAttributes().find("Word");
-					if (words != getEntryAttributes().end()) {
-						for (word = words->second.begin();word != words->second.end(); word++) {
-							strongVal = word->second.find("Lemma");
-							if (strongVal != word->second.end()) {
-								// cheeze.  skip empty article tags that weren't assigned to any text
-								if (strongVal->second == "G3588") {
-									if (word->second.find("Text") == word->second.end())
-										continue;	// no text? let's skip
+						words = getEntryAttributes().find("Word");
+						if (words != getEntryAttributes().end()) {
+							for (word = words->second.begin();word != words->second.end(); word++) {
+								int partCount = atoi(word->second["PartCount"]);
+								if (!partCount) partCount = 1;
+								for (int i = 0; i < partCount; i++) {
+									SWBuf tmp = "Lemma";
+									if (partCount > 1) tmp.appendFormatted(".%d", i+1);
+									strongVal = word->second.find(tmp);
+									if (strongVal != word->second.end()) {
+										// cheeze.  skip empty article tags that weren't assigned to any text
+										if (strongVal->second == "G3588") {
+											if (word->second.find("Text") == word->second.end())
+												continue;	// no text? let's skip
+										}
+										strong.append(strongVal->second);
+										strong.append(' ');
+									}
 								}
-								strong.append(strongVal->second);
-								strong.append(' ');
 							}
 						}
-					}
-					content = getRawEntry();
-					if (content && *content) {
 						proxBuf += content;
 						proxBuf.append(' ');
+						proxLem += strong;
+						if (proxLem.length()) 
+							proxLem.append("\n");
 					}
-					proxLem += strong;
-					if (proxLem.length()) 
-						proxLem.append("\n");
 					(*this)++;
 					err = Error();
 				}
@@ -1129,36 +1142,42 @@
 //printf("building proxBuf from (%s).\n", (const char *)*key);
 //fflush(stdout);
 
-						// build "strong" field
-						strong = "";
-						AttributeTypeList::iterator words;
-						AttributeList::iterator word;
-						AttributeValue::iterator strongVal;
+						content = StripText();
+						if (content && *content) {
+							// build "strong" field
+							strong = "";
+							AttributeTypeList::iterator words;
+							AttributeList::iterator word;
+							AttributeValue::iterator strongVal;
 
-						words = getEntryAttributes().find("Word");
-						if (words != getEntryAttributes().end()) {
-							for (word = words->second.begin();word != words->second.end(); word++) {
-								strongVal = word->second.find("Lemma");
-								if (strongVal != word->second.end()) {
-									// cheeze.  skip empty article tags that weren't assigned to any text
-									if (strongVal->second == "G3588") {
-										if (word->second.find("Text") == word->second.end())
-											continue;	// no text? let's skip
+							words = getEntryAttributes().find("Word");
+							if (words != getEntryAttributes().end()) {
+								for (word = words->second.begin();word != words->second.end(); word++) {
+									int partCount = atoi(word->second["PartCount"]);
+									if (!partCount) partCount = 1;
+									for (int i = 0; i < partCount; i++) {
+										SWBuf tmp = "Lemma";
+										if (partCount > 1) tmp.appendFormatted(".%d", i+1);
+										strongVal = word->second.find(tmp);
+										if (strongVal != word->second.end()) {
+											// cheeze.  skip empty article tags that weren't assigned to any text
+											if (strongVal->second == "G3588") {
+												if (word->second.find("Text") == word->second.end())
+													continue;	// no text? let's skip
+											}
+											strong.append(strongVal->second);
+											strong.append(' ');
+										}
 									}
-									strong.append(strongVal->second);
-									strong.append(' ');
 								}
 							}
-						}
 
-						content = getRawEntry();
-						if (content && *content) {
 							proxBuf += content;
-							proxBuf.append("\n");
+							proxBuf.append(' ');
+							proxLem += strong;
+							if (proxLem.length()) 
+								proxLem.append("\n");
 						}
-						proxLem += strong;
-						if (proxLem.length()) 
-							proxLem.append(' ');
 					} while (tkcheck->nextSibling());
 					tkcheck->parent();
 					tkcheck->firstChild();
@@ -1168,13 +1187,10 @@
 		}
 		
 		if (proxBuf.length() > 0) {
-//printf("proxBuf before (%s).\n%s\n", (const char *)*key, proxBuf.c_str());
-			proxBuf = StripText(proxBuf);
 	
 			lucene_utf8towcs(wcharBuffer, proxBuf, MAX_CONV_SIZE); //keyText must be utf8
 		
-//printf("proxBuf after (%s).\n%s\n", (const char *)*key, proxBuf.c_str());
-			
+//printf("proxBuf after (%s).\nprox: %s\nproxLem: %s\n", (const char *)*key, proxBuf.c_str(), proxLem.c_str());
 
 			doc->add( *Field::UnStored(_T("prox"), wcharBuffer) );
 			good = true;

Modified: trunk/utilities/mkfastmod.cpp
===================================================================
--- trunk/utilities/mkfastmod.cpp	2006-05-22 02:16:43 UTC (rev 1918)
+++ trunk/utilities/mkfastmod.cpp	2006-05-22 07:55:43 UTC (rev 1919)
@@ -64,6 +64,7 @@
 	target->deleteSearchFramework();
 	printf("Building framework, please wait...\n");
 	char lineLen = 70;
+	printf("[0=================================50===============================100]\n ");
 	char error = target->createSearchFramework(&percentUpdate, &lineLen);
 	if (error) {
 		fprintf(stderr, "%s: couldn't create search framework (permissions?)\n", *argv);



More information about the sword-cvs mailing list