[sword-devel] Supporting marked glossary words in Bible modules?

David Haslam dfhdfh at protonmail.com
Fri Feb 15 01:52:51 MST 2019

USFM has a standard method to mark a glossary entry. It's valid even if the glossary itself does not yet exist.

adyeths/u2o Python script converts the SFM markup \w_...\w* to an OSIS index element, for which SWORD seems to lack any support features. Example:

<verse sID="Matt.18.28" osisID="Matt.18.28" n="28" />But that servant went out, and found one of his fellow-servants, who owed him a hundred denarii<index index="Glossary" level1="DENARIUS" />; and he laid hold of him, and took him by the throat, saying: Pay me what you owe.
<verse eID="Matt.18.28" />

That conforms to the OSIS 2.1 Reference Manual, but SWORD makes no use of this construction, AFAICT.

NB. The script already supports the extended syntax for word and character level markup in USFM 3 for word level attributes. i.e. The above example was converted automatically from \w denarii|DENARIUS\w*

xulsword was developed before USFM 3 and does something quite different. A companion glossary module can be specified in a Bible module .conf file. The glossary words in the Biblical text are marked using the reference element with the osisRef attribute that includes the glossary module name as the workID prefix. Example:

$$$Genesis 2:13
İkinci ırmağın adı Gihon'dur, <reference osisRef="TurSozluk:KÛŞ" type="x-glossary">Kûş</reference> sınırları boyunca akar.

The type attribute can be used to identify which references can be shown or hidden by a GlobalOptionFilter using the xulsword GUI. One of these display options is for Glossary words. The filter name is not standard to SWORD.


Aside: I'm assuming that xulsword is based on a fork of the SWORD source code. Correct me if I'm wrong.

Q. What would it take to bring all these insights together?

i.e. So that text developers and module developers could prepare source texts that would result in more useful resources, whereby some Bible modules could be distributed with a companion glossary by CrossWire and others, relying on the notion that our scripts and utilities would do most of the nitty-gritty work automatically.

Best regards,


Sent with ProtonMail Secure Email.

More information about the sword-devel mailing list