Re: [sword-devel] Where is the source code for individual SWORD modules?

2023-10-21 Thread Michael H
The source for the AKJV is at (
https://github.com/BibleCorps/ENG-B-AKJV2018-pd-PSFM/tree/master/p.sfm).

However, this is USFM not OSIS.  Someone (Peter Von Kaehne I think) took
this USFM and turned it into the module that is currently on crosswire.
Usually he has put the resulting code into a crosswire or other gitlab
location.

Note that the code is currently p.sfm. To make it purely USFM, the last 4
lines of each book that end with a tilde ~ should be removed.  These lines
are all valid USFM, but may not produce the meaning they have in p.sfm.
___
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] Where is the source code for individual SWORD modules?

2023-10-21 Thread Peter von Kaehne
Use diatheke, it produces a complete LaTEX document. 

You will need to define a bunch of macros , something I have never come round 
to. If you could produce something reasonable universal to shove back onto our 
server that would be ideal. 

Peter

Sent from my phone. Please forgive misspellings and weird “corrections”

> On 21 Oct 2023, at 08:28, Aaron Rainbolt  wrote:
> 
> On 10/21/23 02:20, Timothy Allen wrote:
>>> On 21/10/23 16:48, Aaron Rainbolt wrote:
>>> mod2imp claims to be able to generate LaTeX (something like `mod2imp -r 
>>> LATEX AKJV`) but at least the Ubuntu build of libsword-utils mod2imp is 
>>> broken in this regard - any time I try to use any of the filters, it tells 
>>> me "mod2imp: Unknown argument: LATEX" or something similar for every single 
>>> possible output format (OSIS, XHTML, RTF, etc.).
>> 
>> That's because it doesn't use a flexible argument parser like getopt or 
>> similar. When the help text says:
>> 
>>usage: mod2imp  [options]
>> 
>> ...it really means it, the options have to go *after* the module name, not 
>> before:
>> 
>>mod2imp -r LATEX AKJV # fails with "Unknown argument"
>> 
>>mod2imp AKJV -r LATEX # succeeds
>> 
> Oh. That explains a lot :P My brain is so used to tools expecting the last 
> argument to be the source file that I read the "" and 
> "[options]" part backwards and thought it expected the module name at the 
> end. So... lesson learned, thank you for catching my silly mistake.
> 
>> ...although in this case, the IMP markup and the LaTeX markup get a bit 
>> mixed and it's not the easiest to work with. You may have better luck with 
>> the example command-line SWORD tool, diatheke:
>> 
>>diatheke -b AKJV -f LATEX -k Genesis
>> 
> I ended up writing a small tool in C# that parsed the IMP markup and spit out 
> incomplete LaTeX code. I used Mono to run the tool under Linux, then took the 
> output and pasted it into a "skeleton" document I had written earlier. (The 
> IMP markup for the AKJV module was really simple thanks to the simplicity of 
> the module itself so it ended up being pretty easy.) If anyone's interested 
> in the end result I got, I'm happy to share it. I think it came out pretty 
> good.
> 
> Aaron
> 
>> Timothy
>> 
>> 
>> ___
>> sword-devel mailing list: sword-devel@crosswire.org
>> http://crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
> ___
> sword-devel mailing list: sword-devel@crosswire.org
> http://crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page

___
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] Where is the source code for individual SWORD modules?

2023-10-21 Thread Aaron Rainbolt

On 10/21/23 02:20, Timothy Allen wrote:

On 21/10/23 16:48, Aaron Rainbolt wrote:
mod2imp claims to be able to generate LaTeX (something like `mod2imp 
-r LATEX AKJV`) but at least the Ubuntu build of libsword-utils 
mod2imp is broken in this regard - any time I try to use any of the 
filters, it tells me "mod2imp: Unknown argument: LATEX" or something 
similar for every single possible output format (OSIS, XHTML, RTF, etc.).


That's because it doesn't use a flexible argument parser like getopt 
or similar. When the help text says:


usage: mod2imp  [options]

...it really means it, the options have to go *after* the module name, 
not before:


mod2imp -r LATEX AKJV # fails with "Unknown argument"

mod2imp AKJV -r LATEX # succeeds

Oh. That explains a lot :P My brain is so used to tools expecting the 
last argument to be the source file that I read the "" and 
"[options]" part backwards and thought it expected the module name at 
the end. So... lesson learned, thank you for catching my silly mistake.


...although in this case, the IMP markup and the LaTeX markup get a 
bit mixed and it's not the easiest to work with. You may have better 
luck with the example command-line SWORD tool, diatheke:


diatheke -b AKJV -f LATEX -k Genesis

I ended up writing a small tool in C# that parsed the IMP markup and 
spit out incomplete LaTeX code. I used Mono to run the tool under Linux, 
then took the output and pasted it into a "skeleton" document I had 
written earlier. (The IMP markup for the AKJV module was really simple 
thanks to the simplicity of the module itself so it ended up being 
pretty easy.) If anyone's interested in the end result I got, I'm happy 
to share it. I think it came out pretty good.


Aaron


Timothy


___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

___
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] Where is the source code for individual SWORD modules?

2023-10-21 Thread Timothy Allen

On 21/10/23 16:48, Aaron Rainbolt wrote:
mod2imp claims to be able to generate LaTeX (something like `mod2imp 
-r LATEX AKJV`) but at least the Ubuntu build of libsword-utils 
mod2imp is broken in this regard - any time I try to use any of the 
filters, it tells me "mod2imp: Unknown argument: LATEX" or something 
similar for every single possible output format (OSIS, XHTML, RTF, etc.).


That's because it doesn't use a flexible argument parser like getopt or 
similar. When the help text says:


   usage: mod2imp  [options]

...it really means it, the options have to go *after* the module name, 
not before:


   mod2imp -r LATEX AKJV # fails with "Unknown argument"

   mod2imp AKJV -r LATEX # succeeds

...although in this case, the IMP markup and the LaTeX markup get a bit 
mixed and it's not the easiest to work with. You may have better luck 
with the example command-line SWORD tool, diatheke:


   diatheke -b AKJV -f LATEX -k Genesis


Timothy
___
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] Where is the source code for individual SWORD modules?

2023-10-20 Thread Aaron Rainbolt
On Sat, Oct 21, 2023 at 12:20 AM Greg Hellings  
wrote:


In general the imported file will not be available since it is not the source 
of those modules. Other than for the KJV itself, Crosswire is not the 
authoritative source of the texts. Often any OSIS file is a product of a 
conversation from the original source. If anything has been kept it should be a 
script to produce that OSIS file so that, if the source material is updated, 
the module can be automatically created from it. Very old modules which have 
not been updated in a decade+ might not have any reproducible material floating 
around at all if they predate that process.


Well, right, I get that, but when the text I want to get at is in the 
form of a SWORD module, I don't need the authoritative source, I just 
need something I can parse and turn into what I want. Which it turns out 
mod2imp will give me, so I guess I don't need the OSIS / TEI / ThML 
sources after all. I just expected that Crosswire probably had them 
somewhere since https://wiki.crosswire.org/DevTools:Modules mentioned 
that Crosswire only accepted module source code when submitting a 
module, not a pre-built module.


The KJV(A) module pair are the exception to this and should be located on the 
server somewhere.

As for generating LaTeX, I thought the engine could already do that? I thought 
Peter had added a filter for that back when he was doing some work with the 
texts. You should be able to iterate module and generate the text from there, 
if a render filter exists for LaTeX. If not, now would be a great time for you 
to learn the filter API (it is akin to an XML SAX style of interface) and write 
one!


mod2imp claims to be able to generate LaTeX (something like `mod2imp -r 
LATEX AKJV`) but at least the Ubuntu build of libsword-utils mod2imp is 
broken in this regard - any time I try to use any of the filters, it 
tells me "mod2imp: Unknown argument: LATEX" or something similar for 
every single possible output format (OSIS, XHTML, RTF, etc.). I should 
try to build SWORD from source and see if that behaves any better.


I don't know what XML SAX even is but it sounds difficult and scary :P 
Might be fun to look into if I get the time though.


Thanks for your help!

Aaron


--Greg

On Fri, Oct 20, 2023, 23:28 Aaron Rainbolt  wrote:


Gah, I am forgetful. I can just use mod2imp to get parsable text. It's
not exactly what I was looking for but it'll work good enough :D

On 10/20/23 23:15, Aaron Rainbolt wrote:
> I don't know if I'm just blind or if these aren't public, but I cannot
> find the OSIS (or whatever format) code for individual SWORD modules
> in the Crosswire repository. Specifically I'm trying to find the
> source for the AKJV module. I'd like to take the code and parse it
> myself for a project of my own (I'm trying to typeset the AKJV
> translation using LaTeX, and may want to do the same sort of thing
> with other modules). As it is, I'm having to open the modules in
> Xiphos, and then copy and paste their text one chapter at a time into
> my formatting tools, which is... cumbersome. If I could get the source
> code for the modules, I could just write a parser that would do the
> whole job for me in one go.
>
> Are the OSIS sources kept private intentionally? If not, where would I
> find them to download them?
>
> (Note that I understand why some modules' source code might be
> private, for things like the NASB module. But it would be nice if the
> code for public domain or otherwise permissively licensed modules were
> available for public download.)
>
___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page


___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

___
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] Where is the source code for individual SWORD modules?

2023-10-20 Thread Timothy Allen

On 21/10/23 15:15, Aaron Rainbolt wrote:
I don't know if I'm just blind or if these aren't public, but I cannot 
find the OSIS (or whatever format) code for individual SWORD modules 
in the Crosswire repository. Specifically I'm trying to find the 
source for the AKJV module.


I get the impression the SWORD project has a lot of different 
contributors with different work-flow preferences, so there's no Central 
Repository of All Modules or anything like that. When I'm looking for 
the source of a module (for example, to find out how some particular 
feature or style was implemented) and the module's description doesn't 
cite a source, I look in the following locations:


 * https://git.crosswire.org/explore
 * https://gitlab.com/crosswire-bible-society/

The AKJV specifically does not appear in either of those locations. Its 
description text mentions the URL http://www.inspiredidea.com/akj.htm 
which no longer exists, but the earliest version on the Wayback Machine 
(2001-02-06) only points to CrossWire as the only official distribution 
source. I suspect that the person who made this version is also the 
person who provided the module to CrossWire and the source might never 
have been publicly accessible. Later revisions of the page (up to about 
2004) do provide a ZIP of the text, but the modification date inside the 
archive is 2001, and the CrossWire module claims to have been made in 
2007 (and be "version 1.4") so it's probably not the actual source text.


mod2imp works, but I don't like to use it to inspect modules because it 
only reports what comes *out* of the osis2mod compiler, not what went 
into it.


If you really want the text of the AKJV specifically, mod2imp may well 
be your best bet at extracting the text.


If you just want the King James Version updated to more modern language, 
you may be interested in the American Standard Version (1901)[1], or the 
World English Bible[2] which is available in many formats from USFM to 
Microsoft Word to XeTeX.



Timothy

[1]: https://gitlab.com/crosswire-bible-society/asv

[2]: https://worldenglish.bible/
___
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] Where is the source code for individual SWORD modules?

2023-10-20 Thread Greg Hellings
In general the imported file will not be available since it is not the
source of those modules. Other than for the KJV itself, Crosswire is not
the authoritative source of the texts. Often any OSIS file is a product of
a conversation from the original source. If anything has been kept it
should be a script to produce that OSIS file so that, if the source
material is updated, the module can be automatically created from it. Very
old modules which have not been updated in a decade+ might not have any
reproducible material floating around at all if they predate that process.

The KJV(A) module pair are the exception to this and should be located on
the server somewhere.

As for generating LaTeX, I thought the engine could already do that? I
thought Peter had added a filter for that back when he was doing some work
with the texts. You should be able to iterate module and generate the text
from there, if a render filter exists for LaTeX. If not, now would be a
great time for you to learn the filter API (it is akin to an XML SAX style
of interface) and write one!

--Greg

On Fri, Oct 20, 2023, 23:28 Aaron Rainbolt  wrote:

> Gah, I am forgetful. I can just use mod2imp to get parsable text. It's
> not exactly what I was looking for but it'll work good enough :D
>
> On 10/20/23 23:15, Aaron Rainbolt wrote:
> > I don't know if I'm just blind or if these aren't public, but I cannot
> > find the OSIS (or whatever format) code for individual SWORD modules
> > in the Crosswire repository. Specifically I'm trying to find the
> > source for the AKJV module. I'd like to take the code and parse it
> > myself for a project of my own (I'm trying to typeset the AKJV
> > translation using LaTeX, and may want to do the same sort of thing
> > with other modules). As it is, I'm having to open the modules in
> > Xiphos, and then copy and paste their text one chapter at a time into
> > my formatting tools, which is... cumbersome. If I could get the source
> > code for the modules, I could just write a parser that would do the
> > whole job for me in one go.
> >
> > Are the OSIS sources kept private intentionally? If not, where would I
> > find them to download them?
> >
> > (Note that I understand why some modules' source code might be
> > private, for things like the NASB module. But it would be nice if the
> > code for public domain or otherwise permissively licensed modules were
> > available for public download.)
> >
> ___
> sword-devel mailing list: sword-devel@crosswire.org
> http://crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
___
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] Where is the source code for individual SWORD modules?

2023-10-20 Thread Aaron Rainbolt
Gah, I am forgetful. I can just use mod2imp to get parsable text. It's 
not exactly what I was looking for but it'll work good enough :D


On 10/20/23 23:15, Aaron Rainbolt wrote:
I don't know if I'm just blind or if these aren't public, but I cannot 
find the OSIS (or whatever format) code for individual SWORD modules 
in the Crosswire repository. Specifically I'm trying to find the 
source for the AKJV module. I'd like to take the code and parse it 
myself for a project of my own (I'm trying to typeset the AKJV 
translation using LaTeX, and may want to do the same sort of thing 
with other modules). As it is, I'm having to open the modules in 
Xiphos, and then copy and paste their text one chapter at a time into 
my formatting tools, which is... cumbersome. If I could get the source 
code for the modules, I could just write a parser that would do the 
whole job for me in one go.


Are the OSIS sources kept private intentionally? If not, where would I 
find them to download them?


(Note that I understand why some modules' source code might be 
private, for things like the NASB module. But it would be nice if the 
code for public domain or otherwise permissively licensed modules were 
available for public download.)



___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page