The problem with OSIS failure to display lemmatization unless Strong's
is also selected is because of line 73 in osisxhtml.cpp:

    70  void processLemma(bool suspendTextPassThru, XMLTag &tag, SWBuf
&buf) {
    71          const char *attrib;
    72          const char *val;
    73          if ((attrib = tag.getAttribute("lemma"))) {
    74                  int count = tag.getAttributePartCount("lemma", ' ');

Picking on the first word of Tisch Matt.1.1 with diatheke -f xhtml in
gdb, when Strong's is selected with lemmatization (-o nl), then "tag" is
found in processLemma() as
    "w lemma=\"strong:G976 lemma.Strong:βιβλος lemma.ANLEX:βιβλος\" 
wn=\"001\""
whereas lemmatization alone (-o l) gives "tag" showing
    "w  savlm=\"strong:G976 lemma.Strong:βιβλος lemma.ANLEX:βιβλος\"" 

Note "lemma" -vs- "savlm". For -o l, line 70 causes the entire effort to
be skipped.

I've attached a somewhat ham-handed patch which handles the needed case,
but it has the fatal side effect that it produces lemmatization even
when neither strong's nor lemmatization is wanted.

Could someone who deals adequately with filter flow take a further look
and offer a working solution?
Index: src/modules/filters/osisxhtml.cpp
===================================================================
--- src/modules/filters/osisxhtml.cpp	(revision 3450)
+++ src/modules/filters/osisxhtml.cpp	(working copy)
@@ -68,13 +68,16 @@
 static inline void outText(char t, SWBuf &o, BasicFilterUserData *u) { if (!u->suspendTextPassThru) o += t; else u->lastSuspendSegment += t; }
 
 void processLemma(bool suspendTextPassThru, XMLTag &tag, SWBuf &buf) {
-	const char *attrib;
+	const char *attrib = NULL, *lemma = NULL, *savlm = NULL;
 	const char *val;
-	if ((attrib = tag.getAttribute("lemma"))) {
-		int count = tag.getAttributePartCount("lemma", ' ');
+	// lemma -vs- savlm is whether we have strongs possibly w/lemmatization or just lemmatization alone.
+	if ((lemma = tag.getAttribute("lemma")) || (savlm = tag.getAttribute("savlm"))) {
+		int count = tag.getAttributePartCount((lemma ? "lemma" : "savlm"), ' ');
 		int i = (count > 1) ? 0 : -1;		// -1 for whole value cuz it's faster, but does the same thing as 0
 		do {
-			attrib = tag.getAttribute("lemma", i, ' ');
+			attrib = tag.getAttribute((lemma ? "lemma" : "savlm"), i, ' ');
+			if (savlm && !strncmp(attrib, "strong", 6))
+				continue;
 			if (i < 0) i = 0;	// to handle our -1 condition
 			val = strchr(attrib, ':');
 			val = (val) ? (val + 1) : attrib;
_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Reply via email to