[jsword-devel] Another patch for WLS verse problem

DM Smith dmsmith555 at yahoo.com
Sun Aug 8 10:33:03 MST 2004


I have put together a patch for the WLS verse problem.
I changed the signature of Filter.toOSIS
from
	void Filter.toOSIS(Element ele, String text)
to
	List Filter.toOSIS(String text)
Each of the implementations create a dummy element and attach OSIS to 
it. The content (i.e. List) of that dummy element is removed and returned.

In PassageAbstractBook I added a method
	void addOSIS(Key k, Element e, List l)
that adds the list of OSIS elements to e.
In PAB getData it is passed the div element.

In SwordBook I overrode that method. It checks the list to see if there 
is a verse element present and if there is not then it adds the verse 
element as the parent of the list and attaches it.

I also changed getText to take a Key instead of a Verse. The idea here 
is that if we had a robustly marked up OSIS document we could get all 
the text at once rather than one verse at a time. This is just a step in 
that direction.

I also made BlockType a Type Safe Enumeration. In doing so I also did it 
to CompressionType. The code is a bit simpler and safer because of it.

I did some testing of the assumptions and found that Webster's 
Dictionary is the only book that has a compression type but does not 
indicate the blocking. I added some code to establish the default as 
BOOK (which is the most frequent), but may not be correct.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: patchverse.zip
Type: application/x-zip-compressed
Size: 6941 bytes
Desc: not available
Url : http://www.crosswire.org/pipermail/jsword-devel/attachments/20040808/65f6c6e5/patchverse-0001.bin


More information about the jsword-devel mailing list