[sword-svn] r1739 - in trunk: . bindings/corba bindings/corba/java/src/org/crosswire/sword/orb bindings/corba/orbitcpp src/modules/filters

scribe at crosswire.org scribe at crosswire.org
Tue Mar 8 13:16:18 MST 2005


Author: scribe
Date: 2005-03-08 13:16:17 -0700 (Tue, 08 Mar 2005)
New Revision: 1739

Modified:
   trunk/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java
   trunk/bindings/corba/orbitcpp/swordorb-impl.hpp
   trunk/bindings/corba/orbitcpp/testclient.cpp
   trunk/bindings/corba/swordorb.idl
   trunk/src/modules/filters/osiswordjs.cpp
   trunk/src/modules/filters/thmlwordjs.cpp
   trunk/usrinst.sh
Log:


Modified: trunk/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java
===================================================================
--- trunk/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java	2005-03-08 03:23:20 UTC (rev 1738)
+++ trunk/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java	2005-03-08 20:16:17 UTC (rev 1739)
@@ -136,11 +136,15 @@
 			System.out.println(module.getRenderText());
 		}
 */
-		module = mgr.getModuleByName("KJV");
+		module = mgr.getModuleByName("WHNU");
+		module.setKeyText("rev.22.21");
+		System.out.println(new String(module.getRawEntry().getBytes("iso8859-1"), "UTF-8"));
+/*
 		boolean lucene = module.hasSearchFramework();
 		SearchHit[] searchResults = module.search("God love world", (lucene)?SearchType.LUCENE:SearchType.MULTIWORD, 0, "");
 		for (int i = 0; i < searchResults.length; i++)
 			System.out.println(searchResults[i].key);
 
+*/
 	}
 }

Modified: trunk/bindings/corba/orbitcpp/swordorb-impl.hpp
===================================================================
--- trunk/bindings/corba/orbitcpp/swordorb-impl.hpp	2005-03-08 03:23:20 UTC (rev 1738)
+++ trunk/bindings/corba/orbitcpp/swordorb-impl.hpp	2005-03-08 20:16:17 UTC (rev 1739)
@@ -36,6 +36,7 @@
 	char *getStripText() throw(CORBA::SystemException) { return CORBA::string_dup((char *)delegate->StripText()); }
 	StringList *getEntryAttribute(const char *level1, const char *level2, const char *level3) throw(CORBA::SystemException);
 	char *getRenderText() throw(CORBA::SystemException) { return CORBA::string_dup((char *)delegate->RenderText()); }
+	char *getRawEntry() throw(CORBA::SystemException) { return CORBA::string_dup((char *)delegate->getRawEntry()); }
 	char *getConfigEntry(const char *key) throw(CORBA::SystemException) { return CORBA::string_dup(((char *)delegate->getConfigEntry(key)) ? (char *)delegate->getConfigEntry(key):SWNULL); }
 	void deleteSearchFramework() throw(CORBA::SystemException) { return delegate->deleteSearchFramework(); }
 	CORBA::Boolean hasSearchFramework() throw(CORBA::SystemException) { return (delegate->hasSearchFramework() && delegate->isSearchOptimallySupported("God", -4, 0, 0)); }

Modified: trunk/bindings/corba/orbitcpp/testclient.cpp
===================================================================
--- trunk/bindings/corba/orbitcpp/testclient.cpp	2005-03-08 03:23:20 UTC (rev 1738)
+++ trunk/bindings/corba/orbitcpp/testclient.cpp	2005-03-08 20:16:17 UTC (rev 1739)
@@ -45,10 +45,12 @@
 		}
 */
 		mgr->setJavascript(true);
-		module = mgr->getModuleByName("WHNU");
-		module->setKeyText("jas.1.9");
-		std::cout << "KeyText: " << module->getKeyText() << "\n";
-		std::cout << "Text: " << module->getRenderText() << "\n";
+		mgr->setGlobalOption("Textual Variants", "Secondary Reading");
+		module = mgr->getModuleByName("NASB");
+		for (module->setKeyText("mat.1.1"); !module->error(); module->next()) {
+			std::cout << "KeyText: " << module->getKeyText() << "\n";
+			std::cout << "Text: " << module->getRenderText() << "\n";
+		}
 /*
 		swordorb::SearchHitList *searchResults;
 		bool lucene = module->hasSearchFramework();

Modified: trunk/bindings/corba/swordorb.idl
===================================================================
--- trunk/bindings/corba/swordorb.idl	2005-03-08 03:23:20 UTC (rev 1738)
+++ trunk/bindings/corba/swordorb.idl	2005-03-08 20:16:17 UTC (rev 1739)
@@ -54,6 +54,7 @@
 	void   begin();
 	string getStripText();
 	string getRenderText();
+	string getRawEntry();
 	string getConfigEntry(in string key);
 	void deleteSearchFramework();
 	boolean hasSearchFramework();

Modified: trunk/src/modules/filters/osiswordjs.cpp
===================================================================
--- trunk/src/modules/filters/osiswordjs.cpp	2005-03-08 03:23:20 UTC (rev 1738)
+++ trunk/src/modules/filters/osiswordjs.cpp	2005-03-08 20:16:17 UTC (rev 1739)
@@ -41,32 +41,32 @@
 
 
 char OSISWordJS::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
-	char token[2112]; // cheese.  Fix.
-	int tokpos = 0;
-	bool intoken = false;
-	bool lastspace = false;
-	int wordNum = 1;
-	char val[128];
-	char *valto;
-	char *ch;
-	
+	if (option) {
+		char token[2112]; // cheese.  Fix.
+		int tokpos = 0;
+		bool intoken = false;
+		bool lastspace = false;
+		int wordNum = 1;
+		char val[128];
+		char *valto;
+		char *ch;
+		
 
-	const SWBuf orig = text;
-	const char * from = orig.c_str();
+		const SWBuf orig = text;
+		const char * from = orig.c_str();
 
-	for (text = ""; *from; ++from) {
-		if (*from == '<') {
-			intoken = true;
-			tokpos = 0;
-			token[0] = 0;
-			token[1] = 0;
-			token[2] = 0;
-			continue;
-		}
-		if (*from == '>') {	// process tokens
-			intoken = false;
-			if ((*token == 'w') && (token[1] == ' ')) {	// Word
-				if (option) {
+		for (text = ""; *from; ++from) {
+			if (*from == '<') {
+				intoken = true;
+				tokpos = 0;
+				token[0] = 0;
+				token[1] = 0;
+				token[2] = 0;
+				continue;
+			}
+			if (*from == '>') {	// process tokens
+				intoken = false;
+				if ((*token == 'w') && (token[1] == ' ')) {	// Word
 					XMLTag wtag(token);
 					SWBuf lemma = wtag.getAttribute("lemma");
 					SWBuf strong = "";
@@ -112,28 +112,28 @@
 
 
 				}
-			}
-			if ((*token == '/') && (token[1] == 'w') && option) {	// Word
-				text += "</w></span>";
+				if ((*token == '/') && (token[1] == 'w') && option) {	// Word
+					text += "</w></span>";
+					continue;
+				}
+				
+				// if not a strongs token, keep token in text
+				text.append('<');
+				text.append(token);
+				text.append('>');
+				
 				continue;
 			}
-			
-			// if not a strongs token, keep token in text
-			text.append('<');
-			text.append(token);
-			text.append('>');
-			
-			continue;
+			if (intoken) {
+				if (tokpos < 2045)
+					token[tokpos++] = *from;
+					token[tokpos+2] = 0;
+			}
+			else	{
+				text.append(*from);
+				lastspace = (*from == ' ');
+			}
 		}
-		if (intoken) {
-			if (tokpos < 2045)
-				token[tokpos++] = *from;
-				token[tokpos+2] = 0;
-		}
-		else	{
-			text.append(*from);
-			lastspace = (*from == ' ');
-		}
 	}
 	return 0;
 }

Modified: trunk/src/modules/filters/thmlwordjs.cpp
===================================================================
--- trunk/src/modules/filters/thmlwordjs.cpp	2005-03-08 03:23:20 UTC (rev 1738)
+++ trunk/src/modules/filters/thmlwordjs.cpp	2005-03-08 20:16:17 UTC (rev 1739)
@@ -41,44 +41,44 @@
 
 
 char ThMLWordJS::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
-	char token[2112]; // cheese.  Fix.
-	int tokpos = 0;
-	bool intoken = false;
-	bool lastspace = false;
-	int word = 1;
-	char val[128];
-	char *valto;
-	char *ch;
-	char wordstr[5];
-	unsigned int textStart = 0, lastAppendLen = 0, textEnd = 0;
-	char gh = 0;
-	SWBuf tmp;
-	bool newText = false;
-	bool needWordOut = false;
-	AttributeValue *wordAttrs = 0;
-	
+	if (option) {
+		char token[2112]; // cheese.  Fix.
+		int tokpos = 0;
+		bool intoken = false;
+		bool lastspace = false;
+		int word = 1;
+		char val[128];
+		char *valto;
+		char *ch;
+		char wordstr[5];
+		unsigned int textStart = 0, lastAppendLen = 0, textEnd = 0;
+		char gh = 0;
+		SWBuf tmp;
+		bool newText = false;
+		bool needWordOut = false;
+		AttributeValue *wordAttrs = 0;
+		
 
-	const SWBuf orig = text;
-	const char * from = orig.c_str();
-	VerseKey *vkey = 0;
-	if (key) {
-		vkey = SWDYNAMIC_CAST(VerseKey, key);
-	}
+		const SWBuf orig = text;
+		const char * from = orig.c_str();
+		VerseKey *vkey = 0;
+		if (key) {
+			vkey = SWDYNAMIC_CAST(VerseKey, key);
+		}
 
-	for (text = ""; *from; from++) {
-		if (*from == '<') {
-			intoken = true;
-			tokpos = 0;
-			token[0] = 0;
-			token[1] = 0;
-			token[2] = 0;
-			textEnd = text.length();
-			continue;
-		}
-		if (*from == '>') {	// process tokens
-			intoken = false;
-			if (!strnicmp(token, "sync type=\"Strongs\" ", 20)) {	// Strongs
-				if (option) {
+		for (text = ""; *from; from++) {
+			if (*from == '<') {
+				intoken = true;
+				tokpos = 0;
+				token[0] = 0;
+				token[1] = 0;
+				token[2] = 0;
+				textEnd = text.length();
+				continue;
+			}
+			if (*from == '>') {	// process tokens
+				intoken = false;
+				if (!strnicmp(token, "sync type=\"Strongs\" ", 20)) {	// Strongs
 					valto = val;
 					for (unsigned int i = 27; token[i] != '\"' && i < 150; i++)
 						*valto++ = token[i];
@@ -89,7 +89,7 @@
 						needWordOut = (word > 2);
 						wordAttrs = &(module->getEntryAttributes()["Word"][wordstr]);
 						(*wordAttrs)["Strongs"] = val;
-//printf("Adding: [\"Word\"][%s][\"Strongs\"] = %s\n", wordstr, val);
+	//printf("Adding: [\"Word\"][%s][\"Strongs\"] = %s\n", wordstr, val);
 						tmp = "";
 						tmp.append(text.c_str()+textStart, (int)(textEnd - textStart));
 						(*wordAttrs)["Text"] = tmp;
@@ -97,152 +97,152 @@
 						SWBuf ts;
 						ts.appendFormatted("%d", textStart);
 						(*wordAttrs)["TextStart"] = ts;
-//printf("Adding: [\"Word\"][%s][\"Text\"] = %s\n", wordstr, tmp.c_str());
+	//printf("Adding: [\"Word\"][%s][\"Text\"] = %s\n", wordstr, tmp.c_str());
 						newText = true;
 					}
 					else {
 						// verb morph
 						(*wordAttrs)["Morph"] = val;
-//printf("Adding: [\"Word\"][%s][\"Morph\"] = %s\n", wordstr, val);
+	//printf("Adding: [\"Word\"][%s][\"Morph\"] = %s\n", wordstr, val);
 					}
+
 				}
-
-			}
-			if (!strncmp(token, "sync type=\"morph\"", 17)) {
-				for (ch = token+17; *ch; ch++) {
-					if (!strncmp(ch, "class=\"", 7)) {
-						valto = val;
-						for (unsigned int i = 7; ch[i] != '\"' && i < 127; i++)
-							*valto++ = ch[i];
-						*valto = 0;
-						(*wordAttrs)["MorphClass"] = val;
-//printf("Adding: [\"Word\"][%s][\"MorphClass\"] = %s\n", wordstr, val);
+				if (!strncmp(token, "sync type=\"morph\"", 17)) {
+					for (ch = token+17; *ch; ch++) {
+						if (!strncmp(ch, "class=\"", 7)) {
+							valto = val;
+							for (unsigned int i = 7; ch[i] != '\"' && i < 127; i++)
+								*valto++ = ch[i];
+							*valto = 0;
+							(*wordAttrs)["MorphClass"] = val;
+	//printf("Adding: [\"Word\"][%s][\"MorphClass\"] = %s\n", wordstr, val);
+						}
+						if (!strncmp(ch, "value=\"", 7)) {
+							valto = val;
+							for (unsigned int i = 7; ch[i] != '\"' && i < 127; i++)
+								*valto++ = ch[i];
+							*valto = 0;
+							(*wordAttrs)["Morph"] = val;
+	//printf("Adding: [\"Word\"][%s][\"Morph\"] = %s\n", wordstr, val);
+						}
 					}
-					if (!strncmp(ch, "value=\"", 7)) {
-						valto = val;
-						for (unsigned int i = 7; ch[i] != '\"' && i < 127; i++)
-							*valto++ = ch[i];
-						*valto = 0;
-						(*wordAttrs)["Morph"] = val;
-//printf("Adding: [\"Word\"][%s][\"Morph\"] = %s\n", wordstr, val);
-					}
+					newText = true;
 				}
-				newText = true;
-			}
-			// if not a strongs token, keep token in text
-			text += '<';
-			text += token;
-			text += '>';
-			if (needWordOut) {
-				char wstr[10];
-				sprintf(wstr, "%03d", word-2);
-				AttributeValue *wAttrs = &(module->getEntryAttributes()["Word"][wstr]);
-				needWordOut = false;
-				SWBuf strong = (*wAttrs)["Strongs"];
-				SWBuf morph = (*wAttrs)["Morph"];
-				SWBuf morphClass = (*wAttrs)["MorphClass"];
-				SWBuf wordText = (*wAttrs)["Text"];
-				SWBuf textSt = (*wAttrs)["TextStart"];
-				if (strong.size()) {
-					char gh = 0;
-					gh = isdigit(strong[0]) ? 0:strong[0];
-					if (!gh) {
-						if (vkey) {
-							gh = vkey->Testament() ? 'H' : 'G';
+				// if not a strongs token, keep token in text
+				text += '<';
+				text += token;
+				text += '>';
+				if (needWordOut) {
+					char wstr[10];
+					sprintf(wstr, "%03d", word-2);
+					AttributeValue *wAttrs = &(module->getEntryAttributes()["Word"][wstr]);
+					needWordOut = false;
+					SWBuf strong = (*wAttrs)["Strongs"];
+					SWBuf morph = (*wAttrs)["Morph"];
+					SWBuf morphClass = (*wAttrs)["MorphClass"];
+					SWBuf wordText = (*wAttrs)["Text"];
+					SWBuf textSt = (*wAttrs)["TextStart"];
+					if (strong.size()) {
+						char gh = 0;
+						gh = isdigit(strong[0]) ? 0:strong[0];
+						if (!gh) {
+							if (vkey) {
+								gh = vkey->Testament() ? 'H' : 'G';
+							}
 						}
-					}
-					else strong << 1;
+						else strong << 1;
 
-					SWModule *sLex = 0;
-					if (gh == 'G') {
-						sLex = defaultGreekLex;
-					}
-					if (gh == 'H') {
-						sLex = defaultHebLex;
-					}
-					if (sLex) {
-						sLex->setKey(strong.c_str());
-						strong = sLex->RenderText();
-					}
-					SWBuf layer = (vkey)?vkey->getOSISRef():key->getText();
-					for (int i = 0; i < layer.size(); i++) {
-						if ((!isdigit(layer[i])) && (!isalpha(layer[i]))) {
-							layer[i] = '_';
+						SWModule *sLex = 0;
+						if (gh == 'G') {
+							sLex = defaultGreekLex;
 						}
+						if (gh == 'H') {
+							sLex = defaultHebLex;
+						}
+						if (sLex) {
+							sLex->setKey(strong.c_str());
+							strong = sLex->RenderText();
+						}
+						SWBuf layer = (vkey)?vkey->getOSISRef():key->getText();
+						for (int i = 0; i < layer.size(); i++) {
+							if ((!isdigit(layer[i])) && (!isalpha(layer[i]))) {
+								layer[i] = '_';
+							}
+						}
+						if (textSt.size()) {
+							int textStr = atoi(textSt.c_str());
+							textStr += lastAppendLen;
+							SWBuf spanStart = "";
+							spanStart.appendFormatted("<div id=\"%s_%s\" class=\"word-layer\">%s<br/>%s</div>", layer.c_str(), wstr, strong.c_str(), morph.c_str());
+							spanStart.appendFormatted("<span onclick=\"wordInfo(\'%s_%s\', \'i2\');\" >", layer.c_str(), wstr);
+							text.insert(textStr, spanStart);
+							lastAppendLen = spanStart.length();
+						}
 					}
-					if (textSt.size()) {
-						int textStr = atoi(textSt.c_str());
-						textStr += lastAppendLen;
-						SWBuf spanStart = "";
-						spanStart.appendFormatted("<div id=\"%s_%s\" class=\"word-layer\">%s<br/>%s</div>", layer.c_str(), wstr, strong.c_str(), morph.c_str());
-						spanStart.appendFormatted("<span onclick=\"wordInfo(\'%s_%s\', \'i2\');\" >", layer.c_str(), wstr);
-						text.insert(textStr, spanStart);
-						lastAppendLen = spanStart.length();
-					}
+
 				}
-
+				if (newText) {
+					textStart = text.length(); newText = false;
+				}
+				continue;
 			}
-			if (newText) {
-				textStart = text.length(); newText = false;
+			if (intoken) {
+				if (tokpos < 2045)
+					token[tokpos++] = *from;
+					token[tokpos+2] = 0;
 			}
-			continue;
+			else	{
+				text += *from;
+				lastspace = (*from == ' ');
+			}
 		}
-		if (intoken) {
-			if (tokpos < 2045)
-				token[tokpos++] = *from;
-				token[tokpos+2] = 0;
-		}
-		else	{
-			text += *from;
-			lastspace = (*from == ' ');
-		}
-	}
 
-				char wstr[10];
-				sprintf(wstr, "%03d", word-1);
-				AttributeValue *wAttrs = &(module->getEntryAttributes()["Word"][wstr]);
-				needWordOut = false;
-				SWBuf strong = (*wAttrs)["Strongs"];
-				SWBuf morph = (*wAttrs)["Morph"];
-				SWBuf morphClass = (*wAttrs)["MorphClass"];
-				SWBuf wordText = (*wAttrs)["Text"];
-				SWBuf textSt = (*wAttrs)["TextStart"];
-				if (strong.size()) {
-					char gh = 0;
-					gh = isdigit(strong[0]) ? 0:strong[0];
-					if (!gh) {
-						if (vkey) {
-							gh = vkey->Testament() ? 'H' : 'G';
-						}
-					}
-					else strong << 1;
+		char wstr[10];
+		sprintf(wstr, "%03d", word-1);
+		AttributeValue *wAttrs = &(module->getEntryAttributes()["Word"][wstr]);
+		needWordOut = false;
+		SWBuf strong = (*wAttrs)["Strongs"];
+		SWBuf morph = (*wAttrs)["Morph"];
+		SWBuf morphClass = (*wAttrs)["MorphClass"];
+		SWBuf wordText = (*wAttrs)["Text"];
+		SWBuf textSt = (*wAttrs)["TextStart"];
+		if (strong.size()) {
+			char gh = 0;
+			gh = isdigit(strong[0]) ? 0:strong[0];
+			if (!gh) {
+				if (vkey) {
+					gh = vkey->Testament() ? 'H' : 'G';
+				}
+			}
+			else strong << 1;
 
-					SWModule *sLex = 0;
-					if (gh == 'G') {
-						sLex = defaultGreekLex;
-					}
-					if (gh == 'H') {
-						sLex = defaultHebLex;
-					}
-					if (sLex) {
-						sLex->setKey(strong.c_str());
-						strong = sLex->RenderText();
-					}
-					SWBuf layer = (vkey)?vkey->getOSISRef():key->getText();
-					for (int i = 0; i < layer.size(); i++) {
-						if ((!isdigit(layer[i])) && (!isalpha(layer[i]))) {
-							layer[i] = '_';
-						}
-					}
-					if (textSt.size()) {
-						int textStr = atoi(textSt.c_str());
-						textStr += lastAppendLen;
-						SWBuf spanStart = "";
-						spanStart.appendFormatted("<div id=\"%s_%s\" class=\"word-layer\">%s<br/>%s</div>", layer.c_str(), wstr, strong.c_str(), morph.c_str());
-						spanStart.appendFormatted("<span onclick=\"wordInfo(\'%s_%s\', \'i2\');\" >", layer.c_str(), wstr);
-						text.insert(textStr, spanStart);
-					}
+			SWModule *sLex = 0;
+			if (gh == 'G') {
+				sLex = defaultGreekLex;
+			}
+			if (gh == 'H') {
+				sLex = defaultHebLex;
+			}
+			if (sLex) {
+				sLex->setKey(strong.c_str());
+				strong = sLex->RenderText();
+			}
+			SWBuf layer = (vkey)?vkey->getOSISRef():key->getText();
+			for (int i = 0; i < layer.size(); i++) {
+				if ((!isdigit(layer[i])) && (!isalpha(layer[i]))) {
+					layer[i] = '_';
 				}
+			}
+			if (textSt.size()) {
+				int textStr = atoi(textSt.c_str());
+				textStr += lastAppendLen;
+				SWBuf spanStart = "";
+				spanStart.appendFormatted("<div id=\"%s_%s\" class=\"word-layer\">%s<br/>%s</div>", layer.c_str(), wstr, strong.c_str(), morph.c_str());
+				spanStart.appendFormatted("<span onclick=\"wordInfo(\'%s_%s\', \'i2\');\" >", layer.c_str(), wstr);
+				text.insert(textStr, spanStart);
+			}
+		}
+	}
 
 	return 0;
 }

Modified: trunk/usrinst.sh
===================================================================
--- trunk/usrinst.sh	2005-03-08 03:23:20 UTC (rev 1738)
+++ trunk/usrinst.sh	2005-03-08 20:16:17 UTC (rev 1739)
@@ -6,11 +6,12 @@
 OPTIONS="--sysconfdir=/etc $OPTIONS"
 OPTIONS="--with-icu $OPTIONS"
 #OPTIONS="--with-vcl $OPTIONS"
-#OPTIONS="--enable-debug $OPTIONS"
+OPTIONS="--enable-debug $OPTIONS"
 #OPTIONS="--enable-profile $OPTIONS"
 OPTIONS="--with-lucene $OPTIONS"
 #OPTIONS="--without-curl $OPTIONS"
 #OPTIONS="--enable-tests $OPTIONS"
+#OPTIONS="--disable-utilities $OPTIONS"
 
 
 CPPFLAGS="$CFLAGS $CPPFLAGS -DUSBINARY" ./configure $OPTIONS $*



More information about the sword-cvs mailing list