[sword-svn] r1858 - in trunk: bindings/corba/java bindings/corba/orbitcpp src/modules/filters

scribe at crosswire.org scribe at crosswire.org
Wed Oct 12 01:25:37 MST 2005


Author: scribe
Date: 2005-10-12 01:25:36 -0700 (Wed, 12 Oct 2005)
New Revision: 1858

Modified:
   trunk/bindings/corba/java/Makefile
   trunk/bindings/corba/java/testclient
   trunk/bindings/corba/orbitcpp/testclient.cpp
   trunk/src/modules/filters/osisstrongs.cpp
   trunk/src/modules/filters/osiswebif.cpp
   trunk/src/modules/filters/osiswordjs.cpp
Log:
Added support for LXXM and Perseus lookups


Modified: trunk/bindings/corba/java/Makefile
===================================================================
--- trunk/bindings/corba/java/Makefile	2005-10-10 13:04:51 UTC (rev 1857)
+++ trunk/bindings/corba/java/Makefile	2005-10-12 08:25:36 UTC (rev 1858)
@@ -1,12 +1,15 @@
 TOMCAT_HOME=/usr/local/tomcat
+JAVA_HOME=/usr/java/j2sdk1.4.2_09
 instdir=/home/scribe/src/swordweb
+JAVA=${JAVA_HOME}/bin/java
+JAVACC=${JAVA_HOME}/bin/javac
 all: src/org/crosswire/sword/orb/SWMgr.java classes/org/crosswire/sword/orb/SwordOrb.class
 
 src/org/crosswire/sword/orb/SWMgr.java: ../swordorb.idl
 	idlj -pkgTranslate swordorb org.crosswire.sword.orb -td src ../swordorb.idl
 
 classes/org/crosswire/sword/orb/SwordOrb.class: src/org/crosswire/sword/orb/SwordOrb.java
-	javac -classpath ${TOMCAT_HOME}/common/lib/servlet-api.jar -d classes -sourcepath src src/org/crosswire/sword/orb/*.java src/org/crosswire/util/*.java
+	${JAVACC} -classpath ${TOMCAT_HOME}/common/lib/servlet-api.jar -d classes -sourcepath src src/org/crosswire/sword/orb/*.java src/org/crosswire/util/*.java
 
 
 clean:

Modified: trunk/bindings/corba/java/testclient
===================================================================
--- trunk/bindings/corba/java/testclient	2005-10-10 13:04:51 UTC (rev 1857)
+++ trunk/bindings/corba/java/testclient	2005-10-12 08:25:36 UTC (rev 1858)
@@ -1,3 +1,3 @@
 #!/bin/sh
-TOMCAT_HOME=/home/tomcat/jakarta-tomcat
-java -cp $TOMCAT_HOME/common/lib/servlet-api.jar:classes org.crosswire.sword.orb.SwordOrb $*
+TOMCAT_HOME=/usr/local/tomcat
+/usr/java/j2sdk1.4.2_09/bin/java -cp $TOMCAT_HOME/common/lib/servlet-api.jar:classes org.crosswire.sword.orb.SwordOrb $*

Modified: trunk/bindings/corba/orbitcpp/testclient.cpp
===================================================================
--- trunk/bindings/corba/orbitcpp/testclient.cpp	2005-10-10 13:04:51 UTC (rev 1857)
+++ trunk/bindings/corba/orbitcpp/testclient.cpp	2005-10-12 08:25:36 UTC (rev 1858)
@@ -7,16 +7,12 @@
 	
 int main (int argc, char *argv[])
 {
-	if (argc != 2)
-	{
-		std::cerr << "Usage:" << std::endl
-				  << "  " << argv[0] << " IOR" << std::endl
-				  << std::endl;
+	if (argc != 2) {
+		std::cerr << "Usage:" << std::endl << "  " << argv[0] << " <IOR>" << std::endl << std::endl;
 		return -1;
 	}
 	
-	try
-	{
+	try {
 		// Initialize ORBit
 		CORBA::ORB_ptr orb = CORBA::ORB_init(argc, argv, "orbit-local-orb");
 
@@ -44,19 +40,28 @@
 			std::cout << "\n";
 		}
 */
-		swordorb::StringList *localeNames = mgr->getAvailableLocales();
-		for (int i = 0; i < localeNames->length(); i++) {
-			std::cout << (*localeNames)[i] << "\n";
-		}
-		mgr->setDefaultLocale("de");
+//		swordorb::StringList *localeNames = mgr->getAvailableLocales();
+//		for (int i = 0; i < localeNames->length(); i++) {
+//			std::cout << (*localeNames)[i] << "\n";
+//		}
+//		mgr->setDefaultLocale("de");
 		mgr->setJavascript(true);
-		mgr->setGlobalOption("Textual Variants", "Secondary Reading");
-		module = mgr->getModuleByName("WHNU");
-		for (module->setKeyText("jas.1.1"); !module->error(); module->next()) {
-			std::cout << "KeyText: " << module->getKeyText() << "\n";
-			std::cout << "Text: " << module->getRenderText() << "\n";
-			break;
-		}
+//		mgr->setGlobalOption("Textual Variants", "Secondary Reading");
+		mgr->setGlobalOption("Strong's Numbers", "Off");
+		module = mgr->getModuleByName("LXXM");
+		std::cout << "Mod Desc: " << module->getDescription() << "\n";
+
+//int i = 0;
+//for (module->begin(); i < 5; i++, module->next()) {
+//		std::cout << "KeyText: " << module->getKeyText() << "\n";
+		module->setKeyText("PsSol/18/2");
+//		module->getRenderText();
+		std::cout << "KeyText: " << module->getKeyText() << "\n";
+		std::cout << "--------------\n";
+		std::cout << "Raw: " << module->getRawEntry() << "\n";
+		std::cout << "--------------\n";
+		std::cout << "Render: " << module->getRenderText() << "\n";
+//}
 /*
 		swordorb::SearchHitList *searchResults;
 		bool lucene = module->hasSearchFramework();
@@ -66,8 +71,8 @@
 		}
 */
 
-		mgr->setGlobalOption("Greek Accents", "Off");
-		std::cout << "\nFiltered text: " << mgr->filterText("Greek Accents", "ὁ θεὸς") << "\n";
+//		mgr->setGlobalOption("Greek Accents", "Off");
+//		std::cout << "\nFiltered text: " << mgr->filterText("Greek Accents", "ὁ θεὸς") << "\n";
 
 		
 	} catch(const CORBA::Exception& ex) {

Modified: trunk/src/modules/filters/osisstrongs.cpp
===================================================================
--- trunk/src/modules/filters/osisstrongs.cpp	2005-10-10 13:04:51 UTC (rev 1857)
+++ trunk/src/modules/filters/osisstrongs.cpp	2005-10-12 08:25:36 UTC (rev 1858)
@@ -118,16 +118,11 @@
 				}
 
 				if (!option) {
-					char *num = strstr(token, "lemma=\"x-Strongs:");
+					// remove all lemmas.  This class should be renamed to OSISLemma
+					char *num = strstr(token, "lemma=\"");
 					if (num) {
 						memcpy(num, "savlm", 5);
 					}
-					else {
-						num = strstr(token, "lemma=\"strong:");
-						if (num) {
-							memcpy(num, "savlm", 5);
-						}
-					}
 				}
 			}
 			if ((*token == '/') && (token[1] == 'w')) {	// Word End

Modified: trunk/src/modules/filters/osiswebif.cpp
===================================================================
--- trunk/src/modules/filters/osiswebif.cpp	2005-10-10 13:04:51 UTC (rev 1857)
+++ trunk/src/modules/filters/osiswebif.cpp	2005-10-12 08:25:36 UTC (rev 1858)
@@ -61,7 +61,7 @@
 				if (attrib = tag.getAttribute("xlit")) {
 					val = strchr(attrib, ':');
 					val = (val) ? (val + 1) : attrib;
-					buf.appendFormatted(" %s", val);
+//					buf.appendFormatted(" %s", val);
 				}
 				if (attrib = tag.getAttribute("gloss")) {
 					val = strchr(attrib, ':');

Modified: trunk/src/modules/filters/osiswordjs.cpp
===================================================================
--- trunk/src/modules/filters/osiswordjs.cpp	2005-10-10 13:04:51 UTC (rev 1857)
+++ trunk/src/modules/filters/osiswordjs.cpp	2005-10-12 08:25:36 UTC (rev 1858)
@@ -70,6 +70,7 @@
 					SWBuf lemma = wtag.getAttribute("lemma");
 					SWBuf strong = "";
 					SWBuf morph = wtag.getAttribute("morph");
+					SWBuf xlit = wtag.getAttribute("xlit");
 					SWBuf src = wtag.getAttribute("src");
 					if (!src.length()) src.appendFormatted("%d", wordNum);
 					src.insert(0, wordSrcPrefix);
@@ -107,6 +108,12 @@
 								lexName = "H";
 						}
 					}
+					else if (!strncmp(xlit.c_str(), "betacode:", 9)) {
+						lexName = "betacode";
+//						const char *m = strchr(xlit.c_str(), ':');
+//						strong = ++m;
+						strong = lemma;
+					}
 					SWBuf wordID;
 					if (vkey) {
 						// optimize for bandwidth and use only the verse as the unique entry id



More information about the sword-cvs mailing list