[sword-devel] osis2mod very happily generates modules with no text visible

DM Smith dmsmith at crosswire.org
Tue Dec 27 09:32:39 MST 2011


Replying to the entire thread:
Debugging:
	The -d flag is very helpful to see what osis2mod is doing.
	You can use the -d flag multiple times as in -d 1 -d 4 or
	add them together as in -d 5 or
	both -d 5 -d 8
	To get full debugging -d 1023

SIGSEGV
	I think Troy and I fixed this in SVN, revision 2669 in versekey.cpp and 2671 in osis2mod.cpp.
	You are using 2562.
	This bug is hit when a chapter is not in the chosen versification.
	Since the output is not flushed with every verse, the raw dat file is not helpful in determining where the problem occurs, but only that it occurs after that point.

David's suggestion for raw text:
	During development, it is best to use raw text as you can open the dat file(s) and see what is present.
	Pretty much it should be everything except verse markers.
	If you use -d 2, it will put verse markers into the output.

Sub-identifiers:
	SWORD engine cannot handle ! in the osisID, so osis2mod strips them off of the osisIDs for verses.
	I did not see any for verses, but only for notes.

Markup of cross references:
	Peter mentioned that references should be marked up.
	In your module you frequently have something like:
	<note osisRef="Gen.1.1" osisID="Gen.1.1!o1" type="crossReference" n="o1">
		14,19;
		Ex 20,11;
		Iz 37,16;
		Jr 32,17;
		1Pa 16,26;
		Neh 9,6;
		Ž 8,4;
		115,15;
		Sk 4,24
	</note>
	The problem with this is that the SWORD and JSword engines won't create clickable references for such a note.
	You should wrap each reference with:
		<reference osisRef="Gen.14.19">14,19</reference>;
		<reference osisRef="Exod.20.11">Ex 20,11</reference>;
		,,,,
	While OSIS allows for more than one reference in an osisRef, SWORD does not handle the linking for it, but only the first listed. Unless the osisRef is for adjacent verses in the same chapter, split each reference into its own tag.

Sub-identifiers:
	osis2mod handles sub-identifiers on a verse's osisID by stripping it off.
	Are there any? I didn't see any.
	-d 128 will output "DEBUG(REF): Found a grain suffix " when it finds one.
	If it finds Gen.1.1!a and later Gen.1.1!b, it will append Gen.1.1!b to what was already found for Gen.1.1.
	To generalize: osis2mod does not care what the order of verses are in the module. It will quite happily re-order them. And if it finds the same verse reference a subsequent time, it will append the text to the verse.
	However, an osisID="Gen.1.1 Gen.1.2!a" followed by osisID="Gen.1.2!b Gen.1.3" will not be handled as you might expect.
	All the text will be stored in the dat file, but the idx files might not point properly.

Book tags:
	Can be either(in order of recommendation):
		<div type="book" osisID="Gen" sID="Gen"/> ... <div eID="Gen"/>
		<div type="book" osisID="Gen">...</div>
	Osis2mod uses the book divs to determine what titles are book titles.
	Osis2mod also uses them to determine whether the book is in the v11n. If they are not present, it assumes they are. This could cause SIGSEGV/
	Osis2mod does not require book divs. But you should have them.

Chapter tags:
	Can be one of (in order of recommendation):
		<chapter osisID="Gen.1" sID="Gen.1"/> ... <chapter eID="Gen.1"/>
		<div type="chapter" sID="Gen.1"/>...<div eID="Gen.1"/>
		<chapter osisID="Gen.1">...</chapter>
		<div type="chapter" osisID="Gen.1">...</div>
	Osis2mod uses the chapter tags to help determine what titles before verse 1 are chapter titles.
	Osis2mod does not require chapter tags, but you should have them.

Verse tags:
	Can be either (in order of recommendation):
		<verse osisID="Gen.1.1" sID="Gen.1.1"/> ... <verse eID="Gen.1.1"/>
		<verse osisID="Gen.1.1">...</verse>
	The milestoned version is probably required when you have robust structural markup (e.g. poetry, section divs, quotations).

eID:
	For each sID, you must have a corresponding eID.
	The use of sID and eID must be properly "nested".
	The value of the sID/eID pair can be anything, but typically it matches the osisID.

I didn't look for other problems in the module.

Hope this helps.

In His Service,	
	DM

On Dec 27, 2011, at 3:27 AM, Matej Cepl wrote:

> On 27.12.2011 01:48, Peter von Kaehne wrote:
>> BTW the text contains an enormous number of references which are not
>> marked up. Once you got the above corrected please attend to this too.
>> It would make the module a lot better.
> 
> Yes, amount of notes and references is one of the reasons I really want to make this to work.
> 
> However, I am not sure what you mean exactly by “references which are not marked up”. Could you elaborate a bit, please?
> 
> Also, so far (I may relax this in the future) the OSIS file is generated by a XSLT transformation from the original XML files used in translation (https://gitorious.org/sword/czekms-csp_bible/blobs/master/CEP2OSIS.xsl). I am not the best XSLT (try the other end of spectrum) so some things may take some time to do. Maybe I rewrite the script in Python (although XSLT works so far too well for me to be tempted) or I may relax this requirement. We’ll see.
> 
> More after New Year!
> 
> Blessings on all of you,
> 
> Matěj
> 
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page




More information about the sword-devel mailing list