[sword-devel] osis search problem

cricketc at gmail.com cricketc at gmail.com
Sun Oct 21 20:14:54 MST 2007


Hey,

I think there's a bug in searching OSIS Bibles, and it goes back to a
thread I started in January. At that point, I was asking about the
diatheke output for <l type="x-br"/>, but that question affects the
searching as well (I'm not concerned about output format right now).

If I search for "cause against" in the ESV (OSIS), I should get Psalm
43:1 as a result. However, in sword-1.5.10 (and previous), it doesn't
show up. I think it's because of the handling of <l type="x-br"> in
osisplain.cpp, and Greg Hellings submitted a patch back in January to
help with the problem. I tried his patch on sword-1.5.10, and it
didn't seem to solve the problem for Psalm 43:1. However, if the '\n'
in the patch is changed to ' ', it works. I'm attaching the patch for
reference.

In that thread in January, Troy gave Psalm 1:3 ("streams of water that
yields") as a search that should work, but it doesn't seem to work
with or without the patch on sword-1.5.10. I'm not sure why. Here's
the relevant parts of the imp ESV text:

works: cause<l eID="x4672" type="x-br"/><l sID="x4673"
type="x-indent"/>against
doesn't work: streams of water<l eID="x3137" type="x-br"/><l
   sID="x3138"/>that yields

For my testing, I'm using diatheke. Hopefully someone with more
knowledge than me can correct me if I'm missing something, and maybe
show me why the Psalm 1:3 search doesn't work. If the patch is the
correct way to fix Psalm 43:1, it'd be great if someone could commit
that to svn.

Thanks for looking at this.
-Benjie
-------------- next part --------------
Index: src/modules/filters/osisplain.cpp
===================================================================
--- src/modules/filters/osisplain.cpp	(revision 2025)
+++ src/modules/filters/osisplain.cpp	(working copy)
@@ -170,6 +170,14 @@
 			}
                 }
 
+		// <l ... type="x-br"/>
+		else if (!strncmp(token, "l", 1)) {
+			const char* type = strstr(token+1, "type=\"");
+			if (type && strncmp(type+6, "x-br", 4)) { // we check for type != x-br
+				userData->supressAdjacentWhitespace = true;
+				buf.append('\n');
+			}
+		}
 		else {
 			return false;  // we still didn't handle token
 		}


More information about the sword-devel mailing list