adyeths / u2o

USFM to OSIS bible format converter.
The Unlicense
18 stars 6 forks source link

Feature request: Support for morphology #110

Closed LAfricain closed 3 years ago

LAfricain commented 3 years ago

Hello, I have no idea how to, but I would like to convert a bible in usfm then in osis. I have morphology entries in this bible, I tried to add it with the strong number, like this:

\w 希伯|strong="H05677:AH09001"\w*

Or like this:

\w 生了|strong="H03205" x-morph="TH8795"\w* 

or:

\w 人就分|strong="H06385" morph="TH8738"\w*

The template used for this text is the KJV, which has the morph like this:

<w morph="strongMorph:TH8804" lemma="strong:H0853 strong:H01254">created</w>

Do you think it's possible to add some support for the morph? If yes you can decide how to write it in the usfm file.

adyeths commented 3 years ago

I need to know more about what didn't work before I can do anything with this issue. I added support for word level attributes, including strongs numbers, quite some time ago. And word level attributes beginning with x- are also implemented. Double check to make sure that you are following the specs in the usfm docs for word level attributes.

adyeths commented 3 years ago

closing this since morphology is already supported in u2o via the x-morph attribute.

LAfricain commented 3 years ago

Hello, I'm working on a module with morph right now. I can work on samples. It's the byz module. The usfm entry is written like this (I can be wrong):

\w βιβλος|strong="G976" morph="N-NSF"\w*

But in the convert osis I have nothing for N-NSF, it's ignored: <w lemma="strong:G976">βιβλος</w>

I tried also with x-morph. Nothing is done.

adyeths commented 3 years ago

There is no morph attribute in usfm. You should use x-morph.

As for it not showing up, there was a bug that caused the morph attribute not to show up. I will upload a fix for that shortly. It may still not work though. I don't have logic in u2o to try to guess what kind of morph codes are being used right now.

LAfricain commented 3 years ago

what kind of morph codes are being used right now

Maybe it depends what dic is used? and the attribute can be written like this: x-morph="Robinson[CODE]" like for strong: strong="G[CODE]"