[sword-devel] [PATCH] Migrate Python bindings installation script from distutils to setuptools, attempt 2

2023-10-02 Thread Aaron Rainbolt
Apologies for my initial failed attempt, I made a number of blunders in 
my first patch.


This second patch:

* Only modifies the CMake build system (the previous changes to 
Autotools was the result of me patching more than was necessary)
* Uses correct indentation (I had spaces and tabs confused before, now 
I'm using tabs correctly)

* Successfully applies against the head of SVN and against the 1.9.0 tarball
* Successfully builds against the 1.9.0 tarball (I haven't tried 
building SVN with this yet)
* Switches the Python setup script embedded in the CMake system from 
using distutils to using setuptools
* Adds a SWORD_PYTHON_INSTALL_ROOT build option for allowing the Python 
bindings to be installed without building a Python egg (works around 
https://github.com/pypa/setuptools/issues/3143)
* Has the patch as an attachment since it appears either GMail or 
Thunderbird potentially mangled my patch last time


As before, everything in the patch is made available under GPLv2.
--- a/bindings/swig/python/CMakeLists.txt	2023-10-02 20:55:56.264801835 -0500
+++ b/bindings/swig/python/CMakeLists.txt	2023-10-02 20:59:53.103289769 -0500
@@ -25,7 +25,7 @@
 
 SET(PY_SCRIPT "#!${PYTHON_EXECUTABLE}
 
-from distutils.core import setup, Extension
+from setuptools import setup, Extension
 setup(
 name='sword',
 version='${SWORD_VERSION}',
@@ -51,8 +51,11 @@
 	WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
 
 # Allow user installation to custom directory
+IF(NOT SWORD_PYTHON_INSTALL_ROOT STREQUAL "")
+	SET(SETUP_ARGS "\"--root=${SWORD_PYTHON_INSTALL_ROOT}\"")
+ENDIF(NOT SWORD_PYTHON_INSTALL_ROOT STREQUAL "")
 IF(NOT SWORD_PYTHON_INSTALL_DIR STREQUAL "")
-	SET(SETUP_ARGS "\"--prefix=${SWORD_PYTHON_INSTALL_DIR}\"")
+	SET(SETUP_ARGS "${SETUP_ARGS}\"--prefix=${SWORD_PYTHON_INSTALL_DIR}\"")
 ENDIF(NOT SWORD_PYTHON_INSTALL_DIR STREQUAL "")
 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/install.cmake.in"
 	   "${CMAKE_CURRENT_BINARY_DIR}/install.cmake")
___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page


Re: [sword-devel] [PATCH] Migrate setup.py files from using distutils to using setuptools

2023-10-02 Thread Aaron Rainbolt
Actually, I realize now that I also am patching a CMake file with the 
distutils -> setuptools transition. That's probably all that's needed 
(though I patched everywhere I saw distutils for good measure and it 
built). I'll resubmit and patch only just the CMake file.


On 10/2/23 20:38, Aaron Rainbolt wrote:
I realize these are autotools files, but they are somehow getting 
pulled into the CMake build process. The spec file for the Fedora 
build is still using CMake, the build was failing because of an 
attempt to use distutils rather than setuptools, and the only places 
where distutils was mentioned was in Python scripts embedded into the 
Autotools files. Patching them fixed the problem, so I assume the 
CMake builds must be using those files to generate the Python scripts 
for installing the Python bindings.


I realize now that my patch was against the 1.9.0 tarball, not against 
the latest SVN revision (why I didn't think to do it against the SVN 
repo, I don't know, but I didn't). The patch doesn't apply for me 
either so scrap this one and I'll submit a new one against the head of 
SVN. Sorry about that.


On 10/2/23 20:27, Greg Hellings wrote:

Aaron,

Your patch fails to apply against the head of SVN for me, with this 
error:


 @ patch -p1 < ../aaron-rainbolt.patch
patching file bindings/swig/oldmake/Makefile.am
Hunk #1 FAILED at 76.
1 out of 1 hunk FAILED -- saving rejects to file 
bindings/swig/oldmake/Makefile.am.rej

patching file bindings/swig/package/Makefile.am
Hunk #1 FAILED at 84.
1 out of 1 hunk FAILED -- saving rejects to file 
bindings/swig/package/Makefile.am.rej

can't find file to patch at input line 35
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--
|diff --git a/bindings/swig/package/Makefile.in
|b/bindings/swig/package/Makefile.in
|index b5f05c9..370a9e7 100644
|--- a/bindings/swig/package/Makefile.in
|+++ b/bindings/swig/package/Makefile.in
--
File to patch:

Furthermore, it looks like you are patching the autotools build 
system, which is not supported in the Python and Perl bindings. Those 
are only supported building through the CMake files. At least, they 
aren't supported by me as I don't go near autotools, and last I knew 
I was the only one working in the Swig bindings.


I don't know why your patch is failing to apply, as I don't believe 
there should be any drift in those Makefiles. I'd be happy to try 
again if you have any advice as to why the patch is not applying.


--Greg

On Thu, Sep 28, 2023 at 11:53 AM Aaron Rainbolt 
 wrote:


    Good morning/evening, and thanks for your time.

    As distutils has been deprecated and finally removed in Python 3.12,
    SWORD is unable to build in Fedora without the following patch.
    The patch:

    * Replaces all references to distutils with their setuptools
    equivalents.

    * Modifies the build system to allow specifying a new CMake 
argument,

    "SWORD_PYTHON_INSTALL_ROOT", which allows setting the installation
    path
    for the Python bindings without generating a Python egg. (This is
    necessary since Python eggs have been deprecated as well and will
    likely
    be removed later. See
    https://github.com/pypa/setuptools/issues/3143 -
    specifying both a --root and a --prefix to the setup.py scripts
    seems to
    work around this issue.)

    All contributions in this patch are made available to the SWORD
    Project
    under the terms of the GNU General Public License version 2.

    Thanks for your consideration, and have a blessed day!

    Aaron

    (P.S. - the reason this appears to be a Git patch is because I
    used Git
    to let me generate a multi-file patch more easily. I realize SWORD
    uses
    SVN, sorry if this looks confusing.)



    From 07b31a74ea920077fa0d69cdab2ab188dd17b322 Mon Sep 17 00:00:00 
2001

    From: Aaron Rainbolt 
    Date: Wed, 27 Sep 2023 10:51:27 -0600
    Subject: [PATCH] Migrate to setuptools

    ---
      bindings/swig/oldmake/Makefile.am   | 2 +-
      bindings/swig/package/Makefile.am   | 3 +--
      bindings/swig/package/Makefile.in   | 3 +--
      bindings/swig/python/CMakeLists.txt | 7 +--
      4 files changed, 8 insertions(+), 7 deletions(-)

    diff --git a/bindings/swig/oldmake/Makefile.am
    b/bindings/swig/oldmake/Makefile.am
    index 45a37ef..789813b 100644
    --- a/bindings/swig/oldmake/Makefile.am
    +++ b/bindings/swig/oldmake/Makefile.am
    @@ -76,7 +76,7 @@ python_makebuild: $(PYTHONSWIG)
      echo "writing python/setup.py"
      @echo "#! /usr/bin/python" > python/setup.py
      @echo "" >> python/setup.py
    -    @echo "from distutils.core import setup, Extension" >>
    python/setup.py
    +    @echo "from setuptools import setup, Extension" >>
    python/setup.py
      @echo "setup (name = \"sword\"," >> python/setup.py
      @echo "    version = \"$(VERSION)\"," >> python/setup.py
      @echo "    maintainer 

Re: [sword-devel] [PATCH] Migrate setup.py files from using distutils to using setuptools

2023-10-02 Thread Aaron Rainbolt
I realize these are autotools files, but they are somehow getting pulled 
into the CMake build process. The spec file for the Fedora build is 
still using CMake, the build was failing because of an attempt to use 
distutils rather than setuptools, and the only places where distutils 
was mentioned was in Python scripts embedded into the Autotools files. 
Patching them fixed the problem, so I assume the CMake builds must be 
using those files to generate the Python scripts for installing the 
Python bindings.


I realize now that my patch was against the 1.9.0 tarball, not against 
the latest SVN revision (why I didn't think to do it against the SVN 
repo, I don't know, but I didn't). The patch doesn't apply for me either 
so scrap this one and I'll submit a new one against the head of SVN. 
Sorry about that.


On 10/2/23 20:27, Greg Hellings wrote:

Aaron,

Your patch fails to apply against the head of SVN for me, with this error:

 @ patch -p1 < ../aaron-rainbolt.patch
patching file bindings/swig/oldmake/Makefile.am
Hunk #1 FAILED at 76.
1 out of 1 hunk FAILED -- saving rejects to file 
bindings/swig/oldmake/Makefile.am.rej

patching file bindings/swig/package/Makefile.am
Hunk #1 FAILED at 84.
1 out of 1 hunk FAILED -- saving rejects to file 
bindings/swig/package/Makefile.am.rej

can't find file to patch at input line 35
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--
|diff --git a/bindings/swig/package/Makefile.in
|b/bindings/swig/package/Makefile.in
|index b5f05c9..370a9e7 100644
|--- a/bindings/swig/package/Makefile.in
|+++ b/bindings/swig/package/Makefile.in
--
File to patch:

Furthermore, it looks like you are patching the autotools build 
system, which is not supported in the Python and Perl bindings. Those 
are only supported building through the CMake files. At least, they 
aren't supported by me as I don't go near autotools, and last I knew I 
was the only one working in the Swig bindings.


I don't know why your patch is failing to apply, as I don't believe 
there should be any drift in those Makefiles. I'd be happy to try 
again if you have any advice as to why the patch is not applying.


--Greg

On Thu, Sep 28, 2023 at 11:53 AM Aaron Rainbolt  
wrote:


Good morning/evening, and thanks for your time.

As distutils has been deprecated and finally removed in Python 3.12,
SWORD is unable to build in Fedora without the following patch.
The patch:

* Replaces all references to distutils with their setuptools
equivalents.

* Modifies the build system to allow specifying a new CMake argument,
"SWORD_PYTHON_INSTALL_ROOT", which allows setting the installation
path
for the Python bindings without generating a Python egg. (This is
necessary since Python eggs have been deprecated as well and will
likely
be removed later. See
https://github.com/pypa/setuptools/issues/3143 -
specifying both a --root and a --prefix to the setup.py scripts
seems to
work around this issue.)

All contributions in this patch are made available to the SWORD
Project
under the terms of the GNU General Public License version 2.

Thanks for your consideration, and have a blessed day!

Aaron

(P.S. - the reason this appears to be a Git patch is because I
used Git
to let me generate a multi-file patch more easily. I realize SWORD
uses
SVN, sorry if this looks confusing.)



From 07b31a74ea920077fa0d69cdab2ab188dd17b322 Mon Sep 17 00:00:00 2001
From: Aaron Rainbolt 
Date: Wed, 27 Sep 2023 10:51:27 -0600
Subject: [PATCH] Migrate to setuptools

---
  bindings/swig/oldmake/Makefile.am   | 2 +-
  bindings/swig/package/Makefile.am   | 3 +--
  bindings/swig/package/Makefile.in   | 3 +--
  bindings/swig/python/CMakeLists.txt | 7 +--
  4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/bindings/swig/oldmake/Makefile.am
b/bindings/swig/oldmake/Makefile.am
index 45a37ef..789813b 100644
--- a/bindings/swig/oldmake/Makefile.am
+++ b/bindings/swig/oldmake/Makefile.am
@@ -76,7 +76,7 @@ python_makebuild: $(PYTHONSWIG)
  echo "writing python/setup.py"
  @echo "#! /usr/bin/python" > python/setup.py
  @echo "" >> python/setup.py
-    @echo "from distutils.core import setup, Extension" >>
python/setup.py
+    @echo "from setuptools import setup, Extension" >>
python/setup.py
  @echo "setup (name = \"sword\"," >> python/setup.py
  @echo "    version = \"$(VERSION)\"," >> python/setup.py
  @echo "    maintainer = \"Sword Developers\"," >>
python/setup.py
diff --git a/bindings/swig/package/Makefile.am
b/bindings/swig/package/Makefile.am
index 14500c3..f44974d 100644
--- a/bindings/swig/package/Makefile.am
+++ b/bindings/swig/package/Makefile.am
@@ -84,8 +84,7 @@ python_makebuild: $(PYTHONSWIG)
   

Re: [sword-devel] [PATCH] Migrate setup.py files from using distutils to using setuptools

2023-10-02 Thread Greg Hellings
Aaron,

Your patch fails to apply against the head of SVN for me, with this error:

 @ patch -p1 < ../aaron-rainbolt.patch
patching file bindings/swig/oldmake/Makefile.am
Hunk #1 FAILED at 76.
1 out of 1 hunk FAILED -- saving rejects to file
bindings/swig/oldmake/Makefile.am.rej
patching file bindings/swig/package/Makefile.am
Hunk #1 FAILED at 84.
1 out of 1 hunk FAILED -- saving rejects to file
bindings/swig/package/Makefile.am.rej
can't find file to patch at input line 35
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--
|diff --git a/bindings/swig/package/Makefile.in
|b/bindings/swig/package/Makefile.in
|index b5f05c9..370a9e7 100644
|--- a/bindings/swig/package/Makefile.in
|+++ b/bindings/swig/package/Makefile.in
--
File to patch:

Furthermore, it looks like you are patching the autotools build system,
which is not supported in the Python and Perl bindings. Those are only
supported building through the CMake files. At least, they aren't supported
by me as I don't go near autotools, and last I knew I was the only one
working in the Swig bindings.

I don't know why your patch is failing to apply, as I don't believe there
should be any drift in those Makefiles. I'd be happy to try again if you
have any advice as to why the patch is not applying.

--Greg

On Thu, Sep 28, 2023 at 11:53 AM Aaron Rainbolt 
wrote:

> Good morning/evening, and thanks for your time.
>
> As distutils has been deprecated and finally removed in Python 3.12,
> SWORD is unable to build in Fedora without the following patch. The patch:
>
> * Replaces all references to distutils with their setuptools equivalents.
>
> * Modifies the build system to allow specifying a new CMake argument,
> "SWORD_PYTHON_INSTALL_ROOT", which allows setting the installation path
> for the Python bindings without generating a Python egg. (This is
> necessary since Python eggs have been deprecated as well and will likely
> be removed later. See https://github.com/pypa/setuptools/issues/3143 -
> specifying both a --root and a --prefix to the setup.py scripts seems to
> work around this issue.)
>
> All contributions in this patch are made available to the SWORD Project
> under the terms of the GNU General Public License version 2.
>
> Thanks for your consideration, and have a blessed day!
>
> Aaron
>
> (P.S. - the reason this appears to be a Git patch is because I used Git
> to let me generate a multi-file patch more easily. I realize SWORD uses
> SVN, sorry if this looks confusing.)
>
>
>
> From 07b31a74ea920077fa0d69cdab2ab188dd17b322 Mon Sep 17 00:00:00 2001
> From: Aaron Rainbolt 
> Date: Wed, 27 Sep 2023 10:51:27 -0600
> Subject: [PATCH] Migrate to setuptools
>
> ---
>   bindings/swig/oldmake/Makefile.am   | 2 +-
>   bindings/swig/package/Makefile.am   | 3 +--
>   bindings/swig/package/Makefile.in   | 3 +--
>   bindings/swig/python/CMakeLists.txt | 7 +--
>   4 files changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/bindings/swig/oldmake/Makefile.am
> b/bindings/swig/oldmake/Makefile.am
> index 45a37ef..789813b 100644
> --- a/bindings/swig/oldmake/Makefile.am
> +++ b/bindings/swig/oldmake/Makefile.am
> @@ -76,7 +76,7 @@ python_makebuild: $(PYTHONSWIG)
>   echo "writing python/setup.py"
>   @echo "#! /usr/bin/python" > python/setup.py
>   @echo "" >> python/setup.py
> -@echo "from distutils.core import setup, Extension" >> python/setup.py
> +@echo "from setuptools import setup, Extension" >> python/setup.py
>   @echo "setup (name = \"sword\"," >> python/setup.py
>   @echo "version = \"$(VERSION)\"," >> python/setup.py
>   @echo "maintainer = \"Sword Developers\"," >> python/setup.py
> diff --git a/bindings/swig/package/Makefile.am
> b/bindings/swig/package/Makefile.am
> index 14500c3..f44974d 100644
> --- a/bindings/swig/package/Makefile.am
> +++ b/bindings/swig/package/Makefile.am
> @@ -84,8 +84,7 @@ python_makebuild: $(PYTHONSWIG)
>   echo "writing python/setup.py"
>   @echo "#! /usr/bin/python" > python/setup.py
>   @echo "" >> python/setup.py
> -@echo "from distutils.core import setup" >> python/setup.py
> -@echo "from distutils.extension import Extension" >> python/setup.py
> +@echo "from setuptools import setup, Extension" >> python/setup.py
>   @echo "import commands" >> python/setup.py
>   @echo "" >> python/setup.py
>   @echo "def pkgconfig(*packages, **kw):" >> python/setup.py
> diff --git a/bindings/swig/package/Makefile.in
> b/bindings/swig/package/Makefile.in
> index b5f05c9..370a9e7 100644
> --- a/bindings/swig/package/Makefile.in
> +++ b/bindings/swig/package/Makefile.in
> @@ -938,8 +938,7 @@ python_makebuild: $(PYTHONSWIG)
>   echo "writing python/setup.py"
>   @echo "#! /usr/bin/python" > python/setup.py
>   @echo "" >> python/setup.py
> -@echo "from distutils.core import setup" >> python/setup.py
> -@echo "from distutils.extension import Extension" >> 

Re: [sword-devel] Creating a version of the BSB module with interlinear support

2023-10-02 Thread Fr Cyrille



Le 02/10/2023 à 10:16, Timothy Allen a écrit :

On 2/10/23 04:46, Fr Cyrille wrote:

I'm very excited to have this module!


Thanks! I'm glad to be able to help.

You can also look at the LXX module, which has quite a lot of 
information in its code.


Is this the module at ?



No: https://github.com/pierre-amadio/LXX


The number is useful for displaying strong numbers in order (if I 
remember correctly) in Bishop (Android).


Which number is that? The "src" attribute or the "n" attribute?


I can't help, you have to ask Troy if I'm right.


Also, where's the best place to obtain Bishop for Android? The wiki 
links to 
 
which gives me a "not found" error.



Yes it should be Google Play...


Finally, if you think it's possible, I'd make an usfm file first, 
because it's much easier to read and correct than an osis.


I've written a program to merge the annotations from the "translation 
table" spreadsheet into the BSB text; because the work is being done 
by a program and not manually, it's a lot easier for me to work with 
the text in OSIS format. It's still possible to edit the USFM sources 
before they're converted to OSIS, but I'd rather keep them as close as 
possible to how the Berean translators supplied them, just in case 
they ever decide to publish an updated version.






Have you also seen Karl's script for building the module, in the 
BSB-draft module folder?


You sent me a copy of some scripts for making the BIBdraft module, but 
I couldn't find any scripts for making the BSBdraft module.


Strange? If you install the BIBdraft module inside the folder you should 
find this script:

cd /home/cyrille/.sword/modules/texts/rawtext/bibdraft/
ls
BuildBIB  BuildBIBnt  BuildBIBot  nt  nt.vss  ot  ot.vss  style.css

Finally, if there's a way of thinking about the construction method 
in such a way that it would eventually be possible to make an 
identical module in other languages (like French, for example).


It's possible because the translators published their mapping between 
source-language words and target-language words. If somebody made a 
French translation of the Bible and published that same information, 
I'm sure it would be easier to make a new module based on that 
information, rather than trying to convert this module to another 
language.




OK we will discuss about this when you are ready with the English.


Thanks for your encouragement!


Timothy.


Le 30/09/2023 à 11:54, Timothy Allen a écrit :


The Berean Standard Bible is available in two machine-readable 
formats: USFM, and "translation tables", a 40MB Excel spreadsheet 
with a row for every Hebrew or Greek word in their chosen source 
texts with the English text it's translated to. I would like to make 
one module with the nice formatting of the USFM sources and the 
metadata from the spreadsheet, so I've spent the last few weeks 
writing a script that runs through them both in parallel and makes s


I agree with you that the module should have as much information as 
possible. But not all of it can be read by the Sword interface. Some 
may not be useful.


You can also look at the LXX module, which has quite a lot of 
information in its code.


The number is useful for displaying strong numbers in order (if I 
remember correctly) in Bishop (Android).


Finally, if you think it's possible, I'd make a usfm file first, 
because it's much easier to read and correct than an osis.


Have you also seen Karl's script for building the module, in the 
BSB-draft module folder?


ure everything lines up, so I'm now confident that I have an 
accurate mapping between them.


My question now is, how can I translate the data from the 
spreadsheet into OSIS?


Here's the information the spreadsheet gives me:

Column
Example
Notes
he_ordinal
1
	"Hebrew Ordinal", increments for each spreadsheet row in the Old 
Testament, set to 99 for each row in the New Testament

el_ordinal
0
	"Greek Ordinal", set to 0 for each row in the Old Testament, 
increments for each row in the New Testament, except for Mark 1:1 
which has a word with the number 18379.5 (presumably something 
needed to be inserted and they didn't want to renumber everything else)

en_ordinal
1
	"English Ordinal", increments for each spreadsheet row (except for 
that word in Mark 1:1)

language
Hebrew
"Hebrew", "Greek", or sometimes "Aramaic"
verse_ordinal
1
	Increments for each verse in the Bible, so every word in Genesis 
1:1 has "1", etc.

source_word
בְּרֵאשִׁ֖ית
	The word in the original source text. Sometimes includes fancy 
brackets to mark sources other than WLC or Nestle 1904: {TR} ⧼RP⧽ 
(WH) 〈NE〉 [NA] ‹SBL› [[ECM]]

transliteration
bə·rê·šîṯ
A transliteration of the source word into the Latin alphabet
grammar_code
Prep-b | N-fs
	A code describing the grammatical 

Re: [sword-devel] Creating a version of the BSB module with interlinear support

2023-10-02 Thread Fr Cyrille



Le 02/10/2023 à 09:38, Timothy Allen a écrit :


Ah, thanks. I did look at that page when I started making my module, 
but I'd forgotten about it by the time I needed this more detailed 
advice. Thanks for reminding me! Using this to update the guesses from 
my original message:


gloss
I *might* be able to try grabbing the first word from the
BDB/Thayer gloss, but that seems error-prone and I probably won't
bother unless somebody really wants it
lemma
This should be used for Strongs numbers, marked up as
"strong:G123" or "strong:H123", but could also be used for storing
the original source text as "lemma.BSB:בְּרֵאשִׁ֖ית" if we assume
a hypothetical lexicon that indexes all the words in the BSB.
morph
This should be used for Robinson morphology codes, so I should not
bother with this until I can figure out how to translate the BSB's
codes to Robinson ones. The wiki page also has "strongMorph" codes
in its examples, but I can't find any extra information on what
system this might refer to. Apparently there aren't any Hebrew
morphology lexicons available for SWORD; maybe someday I could
make one?



For Hebrew we have OSHM module.


POS
Still unclear to me, it's not mentioned on the wiki page
src
Apparently this is for word order in the source language, but it's
not at all clear where "word 1" is. The start of the  element?
The start of the verse? The start of the chapter? The start of the
book? The start of the Bible? Does it not matter, because
front-ends are intended to just sort the words they have?
xlit
Still for the transliteration, simply enough.

According to the wiki page, there's also an "n" attribute not 
mentioned in the official OSIS docs, which is for "marking enumerated 
words". I don't know what this means, and the wiki page doesn't 
include any examples. I'm going to guess I don't need it.



Do I have all that right? Is there anything I've misunderstood?

Also, would it be better to have "lemma.BSB:בְּרֵאשִׁ֖ית" and use the 
same "BSB" lexicon for every word in the entire text, or would it be 
more appropriate to use "lemma.WLC:בְּרֵאשִׁ֖ית" and use different 
lexicons to indicate the different sources used for the translation 
(Nestle1904, TR, NA, SBL, etc.)?



Timothy


On 30/9/23 20:00, David Haslam wrote:

Hi Timothy,

Please consult the developers’ wiki

https://wiki.crosswire.org/

And consult the page about OSIS Bibles.

David

Sent from Proton Mail  for iOS


On Sat, Sep 30, 2023 at 10:54, Timothy Allen  wrote:


The Berean Standard Bible is available in two machine-readable 
formats: USFM, and "translation tables", a 40MB Excel spreadsheet 
with a row for every Hebrew or Greek word in their chosen source 
texts with the English text it's translated to. I would like to make 
one module with the nice formatting of the USFM sources and the 
metadata from the spreadsheet, so I've spent the last few weeks 
writing a script that runs through them both in parallel and makes 
sure everything lines up, so I'm now confident that I have an 
accurate mapping between them.


My question now is, how can I translate the data from the 
spreadsheet into OSIS?


Here's the information the spreadsheet gives me:

Column
Example
Notes
he_ordinal
1
	"Hebrew Ordinal", increments for each spreadsheet row in the Old 
Testament, set to 99 for each row in the New Testament

el_ordinal
0
	"Greek Ordinal", set to 0 for each row in the Old Testament, 
increments for each row in the New Testament, except for Mark 1:1 
which has a word with the number 18379.5 (presumably something 
needed to be inserted and they didn't want to renumber everything else)

en_ordinal
1
	"English Ordinal", increments for each spreadsheet row (except for 
that word in Mark 1:1)

language
Hebrew
"Hebrew", "Greek", or sometimes "Aramaic"
verse_ordinal
1
	Increments for each verse in the Bible, so every word in Genesis 
1:1 has "1", etc.

source_word
בְּרֵאשִׁ֖ית
	The word in the original source text. Sometimes includes fancy 
brackets to mark sources other than WLC or Nestle 1904: {TR} ⧼RP⧽ 
(WH) 〈NE〉 [NA] ‹SBL› [[ECM]]

transliteration
bə·rê·šîṯ
A transliteration of the source word into the Latin alphabet
grammar_code
Prep-b | N-fs
	A code describing the grammatical form of the word; these don't 
appear to be Robinson codes, but their own custom thing for Hebrew 
(https://biblehub.com/hebrewparse.htm) and Greek 
(https://biblehub.com/abbrev.htm)

grammar_description
Preposition-b | Noun - feminine singular
The grammar code, unabbreviated
strongs_number
7225
The Strongs number of the basic form of this word
translation
In the beginning
The English text that appears in the BSB
gloss
1) first, beginning, best, 

Re: [sword-devel] Creating a version of the BSB module with interlinear support

2023-10-02 Thread Timothy Allen

On 2/10/23 04:46, Fr Cyrille wrote:

I'm very excited to have this module!


Thanks! I'm glad to be able to help.

You can also look at the LXX module, which has quite a lot of 
information in its code.


Is this the module at ?

The number is useful for displaying strong numbers in order (if I 
remember correctly) in Bishop (Android).


Which number is that? The "src" attribute or the "n" attribute?

Also, where's the best place to obtain Bishop for Android? The wiki 
links to 
 
which gives me a "not found" error.


Finally, if you think it's possible, I'd make an usfm file first, 
because it's much easier to read and correct than an osis.


I've written a program to merge the annotations from the "translation 
table" spreadsheet into the BSB text; because the work is being done by 
a program and not manually, it's a lot easier for me to work with the 
text in OSIS format. It's still possible to edit the USFM sources before 
they're converted to OSIS, but I'd rather keep them as close as possible 
to how the Berean translators supplied them, just in case they ever 
decide to publish an updated version.


Have you also seen Karl's script for building the module, in the 
BSB-draft module folder?


You sent me a copy of some scripts for making the BIBdraft module, but I 
couldn't find any scripts for making the BSBdraft module.


Finally, if there's a way of thinking about the construction method in 
such a way that it would eventually be possible to make an identical 
module in other languages (like French, for example).


It's possible because the translators published their mapping between 
source-language words and target-language words. If somebody made a 
French translation of the Bible and published that same information, I'm 
sure it would be easier to make a new module based on that information, 
rather than trying to convert this module to another language.


Thanks for your encouragement!


Timothy.


Le 30/09/2023 à 11:54, Timothy Allen a écrit :


The Berean Standard Bible is available in two machine-readable 
formats: USFM, and "translation tables", a 40MB Excel spreadsheet 
with a row for every Hebrew or Greek word in their chosen source 
texts with the English text it's translated to. I would like to make 
one module with the nice formatting of the USFM sources and the 
metadata from the spreadsheet, so I've spent the last few weeks 
writing a script that runs through them both in parallel and makes s


I agree with you that the module should have as much information as 
possible. But not all of it can be read by the Sword interface. Some 
may not be useful.


You can also look at the LXX module, which has quite a lot of 
information in its code.


The number is useful for displaying strong numbers in order (if I 
remember correctly) in Bishop (Android).


Finally, if you think it's possible, I'd make a usfm file first, 
because it's much easier to read and correct than an osis.


Have you also seen Karl's script for building the module, in the 
BSB-draft module folder?


ure everything lines up, so I'm now confident that I have an accurate 
mapping between them.


My question now is, how can I translate the data from the spreadsheet 
into OSIS?


Here's the information the spreadsheet gives me:

Column
Example
Notes
he_ordinal
1
	"Hebrew Ordinal", increments for each spreadsheet row in the Old 
Testament, set to 99 for each row in the New Testament

el_ordinal
0
	"Greek Ordinal", set to 0 for each row in the Old Testament, 
increments for each row in the New Testament, except for Mark 1:1 
which has a word with the number 18379.5 (presumably something needed 
to be inserted and they didn't want to renumber everything else)

en_ordinal
1
	"English Ordinal", increments for each spreadsheet row (except for 
that word in Mark 1:1)

language
Hebrew
"Hebrew", "Greek", or sometimes "Aramaic"
verse_ordinal
1
	Increments for each verse in the Bible, so every word in Genesis 1:1 
has "1", etc.

source_word
בְּרֵאשִׁ֖ית
	The word in the original source text. Sometimes includes fancy 
brackets to mark sources other than WLC or Nestle 1904: {TR} ⧼RP⧽ 
(WH) 〈NE〉 [NA] ‹SBL› [[ECM]]

transliteration
bə·rê·šîṯ
A transliteration of the source word into the Latin alphabet
grammar_code
Prep-b | N-fs
	A code describing the grammatical form of the word; these don't 
appear to be Robinson codes, but their own custom thing for Hebrew 
(https://biblehub.com/hebrewparse.htm) and Greek 
(https://biblehub.com/abbrev.htm)

grammar_description
Preposition-b | Noun - feminine singular
The grammar code, unabbreviated
strongs_number
7225
The Strongs number of the basic form of this word
translation
In the beginning
The English text that appears in the BSB
gloss

Re: [sword-devel] Creating a version of the BSB module with interlinear support

2023-10-02 Thread David Haslam
Morphology is not restricted to Robinson.

The wiki page merely gave that as an example.

A different morphology dictionary could be specified in the OSIS header.

That can be done even before any such dictionary module has been created.

David

Sent from [Proton Mail](https://proton.me/mail/home) for iOS

On Mon, Oct 2, 2023 at 08:38, Timothy Allen <[thrist...@gmail.com](mailto:On 
Mon, Oct 2, 2023 at 08:38, Timothy Allen < wrote:

> Ah, thanks. I did look at that page when I started making my module, but I'd 
> forgotten about it by the time I needed this more detailed advice. Thanks for 
> reminding me! Using this to update the guesses from my original message:
>
> gloss I *might* be able to try grabbing the first word from the BDB/Thayer 
> gloss, but that seems error-prone and I probably won't bother unless somebody 
> really wants it lemma This should be used for Strongs numbers, marked up as 
> "strong:G123" or "strong:H123", but could also be used for storing the 
> original source text as "lemma.BSB:בְּרֵאשִׁ֖ית" if we assume a hypothetical 
> lexicon that indexes all the words in the BSB. morph This should be used for 
> Robinson morphology codes, so I should not bother with this until I can 
> figure out how to translate the BSB's codes to Robinson ones. The wiki page 
> also has "strongMorph" codes in its examples, but I can't find any extra 
> information on what system this might refer to. Apparently there aren't any 
> Hebrew morphology lexicons available for SWORD; maybe someday I could make 
> one? POS Still unclear to me, it's not mentioned on the wiki page src 
> Apparently this is for word order in the source language, but it's not at all 
> clear where "word 1" is. The start of the  element? The start of the 
> verse? The start of the chapter? The start of the book? The start of the 
> Bible? Does it not matter, because front-ends are intended to just sort the 
> words they have? xlit Still for the transliteration, simply enough.
>
> According to the wiki page, there's also an "n" attribute not mentioned in 
> the official OSIS docs, which is for "marking enumerated words". I don't know 
> what this means, and the wiki page doesn't include any examples. I'm going to 
> guess I don't need it.
>
> Do I have all that right? Is there anything I've misunderstood?
>
> Also, would it be better to have "lemma.BSB:בְּרֵאשִׁ֖ית" and use the same 
> "BSB" lexicon for every word in the entire text, or would it be more 
> appropriate to use "lemma.WLC:בְּרֵאשִׁ֖ית" and use different lexicons to 
> indicate the different sources used for the translation (Nestle1904, TR, NA, 
> SBL, etc.)?
>
> Timothy
>
> On 30/9/23 20:00, David Haslam wrote:
>
>> Hi Timothy,
>>
>> Please consult the developers’ wiki
>>
>> https://wiki.crosswire.org/
>>
>> And consult the page about OSIS Bibles.
>>
>> David
>>
>> Sent from [Proton Mail](https://proton.me/mail/home) for iOS
>>
>> On Sat, Sep 30, 2023 at 10:54, Timothy Allen 
>> <[thrist...@gmail.com](mailto:On Sat, Sep 30, 2023 at 10:54, Timothy Allen 
>> < wrote:
>>
>>> The Berean Standard Bible is available in two machine-readable formats: 
>>> USFM, and "translation tables", a 40MB Excel spreadsheet with a row for 
>>> every Hebrew or Greek word in their chosen source texts with the English 
>>> text it's translated to. I would like to make one module with the nice 
>>> formatting of the USFM sources and the metadata from the spreadsheet, so 
>>> I've spent the last few weeks writing a script that runs through them both 
>>> in parallel and makes sure everything lines up, so I'm now confident that I 
>>> have an accurate mapping between them.
>>>
>>> My question now is, how can I translate the data from the spreadsheet into 
>>> OSIS?
>>>
>>> Here's the information the spreadsheet gives me:
>>>
>>> Column  Example Notes
>>> he_ordinal  1   "Hebrew Ordinal", increments for each spreadsheet row 
>>> in the Old Testament, set to 99 for each row in the New Testament
>>> el_ordinal  0   "Greek Ordinal", set to 0 for each row in the Old 
>>> Testament, increments for each row in the New Testament, except for Mark 
>>> 1:1 which has a word with the number 18379.5 (presumably something needed 
>>> to be inserted and they didn't want to renumber everything else)
>>> en_ordinal  1   "English Ordinal", increments for each spreadsheet row 
>>> (except for that word in Mark 1:1)
>>> languageHebrew  "Hebrew", "Greek", or sometimes "Aramaic"
>>> verse_ordinal   1   Increments for each verse in the Bible, so 
>>> every word in Genesis 1:1 has "1", etc.
>>> source_word בְּרֵאשִׁ֖יתThe word in the original source text. Sometimes 
>>> includes fancy brackets to mark sources other than WLC or Nestle 1904: {TR} 
>>> ⧼RP⧽ (WH) 〈NE〉 [NA] ‹SBL› [[ECM]]
>>> transliteration bə·rê·šîṯ   A transliteration of the source word 
>>> into the Latin alphabet
>>> grammar_codePrep-b | N-fs   A code describing the grammatical form 
>>> of the word; 

Re: [sword-devel] Creating a version of the BSB module with interlinear support

2023-10-02 Thread Timothy Allen
Ah, thanks. I did look at that page when I started making my module, but 
I'd forgotten about it by the time I needed this more detailed advice. 
Thanks for reminding me! Using this to update the guesses from my 
original message:


gloss
   I *might* be able to try grabbing the first word from the BDB/Thayer
   gloss, but that seems error-prone and I probably won't bother unless
   somebody really wants it
lemma
   This should be used for Strongs numbers, marked up as "strong:G123"
   or "strong:H123", but could also be used for storing the original
   source text as "lemma.BSB:בְּרֵאשִׁ֖ית" if we assume a hypothetical
   lexicon that indexes all the words in the BSB.
morph
   This should be used for Robinson morphology codes, so I should not
   bother with this until I can figure out how to translate the BSB's
   codes to Robinson ones. The wiki page also has "strongMorph" codes
   in its examples, but I can't find any extra information on what
   system this might refer to. Apparently there aren't any Hebrew
   morphology lexicons available for SWORD; maybe someday I could make one?
POS
   Still unclear to me, it's not mentioned on the wiki page
src
   Apparently this is for word order in the source language, but it's
   not at all clear where "word 1" is. The start of the  element?
   The start of the verse? The start of the chapter? The start of the
   book? The start of the Bible? Does it not matter, because front-ends
   are intended to just sort the words they have?
xlit
   Still for the transliteration, simply enough.

According to the wiki page, there's also an "n" attribute not mentioned 
in the official OSIS docs, which is for "marking enumerated words". I 
don't know what this means, and the wiki page doesn't include any 
examples. I'm going to guess I don't need it.



Do I have all that right? Is there anything I've misunderstood?

Also, would it be better to have "lemma.BSB:בְּרֵאשִׁ֖ית" and use the 
same "BSB" lexicon for every word in the entire text, or would it be 
more appropriate to use "lemma.WLC:בְּרֵאשִׁ֖ית" and use different 
lexicons to indicate the different sources used for the translation 
(Nestle1904, TR, NA, SBL, etc.)?



Timothy


On 30/9/23 20:00, David Haslam wrote:

Hi Timothy,

Please consult the developers’ wiki

https://wiki.crosswire.org/

And consult the page about OSIS Bibles.

David

Sent from Proton Mail  for iOS


On Sat, Sep 30, 2023 at 10:54, Timothy Allen  wrote:


The Berean Standard Bible is available in two machine-readable 
formats: USFM, and "translation tables", a 40MB Excel spreadsheet 
with a row for every Hebrew or Greek word in their chosen source 
texts with the English text it's translated to. I would like to make 
one module with the nice formatting of the USFM sources and the 
metadata from the spreadsheet, so I've spent the last few weeks 
writing a script that runs through them both in parallel and makes 
sure everything lines up, so I'm now confident that I have an 
accurate mapping between them.


My question now is, how can I translate the data from the spreadsheet 
into OSIS?


Here's the information the spreadsheet gives me:

Column
Example
Notes
he_ordinal
1
	"Hebrew Ordinal", increments for each spreadsheet row in the Old 
Testament, set to 99 for each row in the New Testament

el_ordinal
0
	"Greek Ordinal", set to 0 for each row in the Old Testament, 
increments for each row in the New Testament, except for Mark 1:1 
which has a word with the number 18379.5 (presumably something needed 
to be inserted and they didn't want to renumber everything else)

en_ordinal
1
	"English Ordinal", increments for each spreadsheet row (except for 
that word in Mark 1:1)

language
Hebrew
"Hebrew", "Greek", or sometimes "Aramaic"
verse_ordinal
1
	Increments for each verse in the Bible, so every word in Genesis 1:1 
has "1", etc.

source_word
בְּרֵאשִׁ֖ית
	The word in the original source text. Sometimes includes fancy 
brackets to mark sources other than WLC or Nestle 1904: {TR} ⧼RP⧽ 
(WH) 〈NE〉 [NA] ‹SBL› [[ECM]]

transliteration
bə·rê·šîṯ
A transliteration of the source word into the Latin alphabet
grammar_code
Prep-b | N-fs
	A code describing the grammatical form of the word; these don't 
appear to be Robinson codes, but their own custom thing for Hebrew 
(https://biblehub.com/hebrewparse.htm) and Greek 
(https://biblehub.com/abbrev.htm)

grammar_description
Preposition-b | Noun - feminine singular
The grammar code, unabbreviated
strongs_number
7225
The Strongs number of the basic form of this word
translation
In the beginning
The English text that appears in the BSB
gloss
1) first, beginning, best, chief
1a) beginning
1b) first
1c) chief
1d) choice part
	A definition from the Brown-Driver-Briggs Hebrew Lexicon, or