[sword-devel] morphcode: specification, and frontend usage ?

pierre amadio amadio.pierre at gmail.com
Thu Feb 4 12:42:14 EST 2021


Hello.

Too long to read: the way the morphology information is being dealt
with in Osis/Sword is  not optimal.
If you are either a frontend developer or involved in the Osis
specifications, you can probably help.

I noticed the following issue in the current (2.5) LXX module:

LXX use "-" instead of " " to separate chunck of morph code.

By example in genesis 1:1 εποιησεν is associated with morph code
"packard:V-AAI-3S"
That is supposed to mean Verb Aorist Active Infinitive 3person Singular.
Using the code with - as separator make the sword module generate
wrong information:
"diatheke -b Packard -k V-AAI-3S" gives pluperfect passive 3person singular
"diatheke -b Packard -k V AAI 3S" gives the right feedback.

According to the following, the space separator is the right one indeed:

http://ccat.sas.upenn.edu/gopher/text/religion/biblical/lxxmorph/*Morph-Coding

As i am trying to make a new LXX module, I had a look at how frontend
deal with morph code.

- I was not able to make the feature work at all with Bibletime
(although i saw the option for one module, i think MorphGNT, i never
managed to actually see the "mag" window. I try the latest git build
and with bibletime-3.0-2.fc33.src.rpm). This may be because of the
display i m using (virt-display). I did not progress further than
that.

- I did not find this feature (show morph code) with Ezra Project.

- Xiphos has such a feature, but it works correclty only with MorphGNT.

Looking at /src/main/url.cc's
show_morph(module_name,stype,svalue,clicked) I think this is what is
happening:

The code is trying to get information about the morph code from a url
looking like this:
file:///passagestudy.jsp?action=showMorph&type=packard%3ARA+NSM&value=RA

The function try to detect if the type of morphcode start with greek,
Robinson or x-robinson and check which testament we are in in order to
choose the right morph code module.
- New testament: packard or robinson according to the hint in the type entry
- Old testament: packard.

No mention at all of oshm, so the hebrew bible is ignored.
If the morphcode start with packard: it does not pass the first test
and it is ignored.

Here is some content of the stype and svalue with different modules:

     * with MorphGNT: stype="robinson:N-NSF" svalue="N-NSF"
     * with OSHB: stype="oshm:HC/To" svalue="HC/To"
     * with LXX 2.5: stype="packard:V-AAI-3S" svalue="V-AAI-3S"
     * with my test LXX: stype="packard:VAI AAI3S" svalue="VAI"

With the LXX module i build i have this in the osis morph="packard:VAI AAI3S".
The first chunk is a bit different than in the version 2.5 : "VAI
AAI3S" instead of "V AAI 3S", I do not understand clearly wich one is
more grammatically correct. The second one is probably a bit more
precise as it also tells there is an augment and that this is a 1st
aorist.

I think this would be the ideal situation:

- correct morph code in all book modules, obviously.
- all morph tag build like: morph="moduleid:code string" in the osis.

Then, specificall in Xiphos:

- whatever code is preparing the passagestudy.jsp url should get the
stype and svalue correctly.
I think this is done in src/main/display.cc but to be honest, I fail
to understand clearly what it is doing.
I guess having a space as a meaningfull character in the morphcode was
considered painfull, so it was decided to change that to -, and the
existing LXX module was build with this separator, but without
actually checking if the resulting morphcode were correctly understood
by the sword engine.

Strangely enough, if i "grep -r nightmare" in the source code, the hit
are the file involved with this feature: url.cc and display.cc  :-)

- If the passagestudy.jsp url were correct, all left to do in the
show_morph function would be to look at the stype attribute to choose
the right module to send the svalue query to.

As there is currently already the full information in the stype
argument of show_morph, i gave a try changing only show_morphocde,
hoping it would be a simple matter of building the right regular
expression, fetching the data from it, and then doing exactly what is
done in the existing code.

Well, turns out I fail to even use a simple regular expression, and I
have no idea why (if you have, I would be interested to know, more
details in comments here
https://github.com/pierre-amadio/xiphos/blob/morphcode/src/main/url.cc#L336
)


So, I have some questions for you:

- For whoever is involved with the OSIS format:
a) What should be the next step to have the morph attribute of the w
node officially required to be formated in such a way to mention the
actual type of morphology code it is using ?
b) Would it be possible to have some documentation as to what is valid
and what is not for the other attributes (in particular savlm and
lemma) ?

- For whoever is involved in a frontend, having morphology code
feature implemented would be great, thanks to consider it !


More information about the sword-devel mailing list