Jump to content

Please read the Forum Rules before posting.

Photo

Computer Science: e-Sword and Databases. Part 2


  • Please log in to reply
20 replies to this topic

#1 APsit190

APsit190

    e-Sword Tools Developer

  • Members (T)
  • PipPipPipPipPip
  • 2,870 posts
  • LocationLand of the Long White Cloud (AKA New Zealand)
Offline

Posted 12 April 2012 - 07:53 PM

The Introductory bit that has to be said :lol:

This is part two of e-Sword and Databases, and in this part I want to discuss how e-Sword reads the data, the information placed in the database.

If you remember, in the outset of Part 1, I said:

Primarily and basically e-Sword is a Database Reader, in that it reads only database files.


This is very important to remember because a Database has only one primary function, and that is to gather data, and that data can be any sort, shape or size. It is an all or nothing tool, and it will display only what is put into it. Leave anything out in the database, it won't display it. So in the way that e-Sword reads the data, all that information has to be placed in the database before e-Sword can read it.


Where e-Sword puts the data

When a database file is opened in e-Sword these Fields and Records placed in a certain order and in a certain place.

In part one we looked at a Bible Database file, and in that file we have seen that it was made up of Tables, Fields, and Records. We learned that the Bible Table had the following Fields:
  • Book
  • Chapter
  • Verse
  • Scripture
The Bible Tree displays both the Book and Chapter Fields. The Verse and Scripture Fields are displayed in the main Bible Window. But the data in the Book Field has been changed to read a name, and verses are displayed as part of a complete reference. But when the Look up Scripture Reference Dialog is opened, there you see (from left to right) The Book Field displaying the name of the Books of the Bible, followed by the Chapters of the the selected book, and then the verses of the Chapter selected.

How e-Sword reads and outputs the data

1. Getting it all sorted.

We also learned that in regards to the Book, Chapter, and Verse Fields, they have been given an Integer (whole number) value. With regard to the Book Field, When e-Sword reads them, those numbers are converted to a String Output in where they are given a name. So when e-Sword reads the number 1, it outputs a String called, Genesis. A String is a length of text.

In the Bible View (Window) The following database information is displayed:
  • The selected book of the Bible from the Bible Field
  • The selected Chapter from the Chapter Field
  • All the verses related to the chapter in the Verse Field
  • All the text in the Scripture Field related to the above Fields.
So when a Book and a Chapter of the Bible is selected from the Bible tree, all the information pertaining just to that part of the Database is displayed in the Bible window. Select another chapter in the Bible tree, all information from the previous chapter is cleared, and the new information is displayed.

2. Making it all look readable and pretty

One thing you will notice in e-Sword is that the data is displayed in a certain way that makes it readable and presentable. This is Formatting. But the problem with a Database is that it can't and it doesn't cause the Data to be presented in such a way that makes it look readable and pretty. All a Database can do is give information and nothing more. A Database program such as SQLite, MS Access, Oracle, Paradox and etc., do not have text formatting capabilities. and for what they are used for neither should they have them. But we like text to have a pleasant appearance to our eyes that makes it good to read. So in order for that to happen extra data/information has to be put in the database in order for that to happen.

But that's not all. In real life there are people who speak different languages read in different languages, have different kinds of text and not all languages use Roman/English kinds of Text. Some countries read Right to Left (Horizontal), in other countries read Up and Down (Vertical), and in all English and most European countries we read Left to Right. And its here that Databases are not good at all, in fact they pretty much useless in trying to detect what kind of text and language the user has to have.

So all of these things have to be put into the a Database so that the user can read the information/data, and so we come to a crucial part of what has to be done to the data for it to be understandable.

A. Language Settings and UTF
SQLite Database uses UTF for reading language settings and fonts, and for Hebrew, Arabic, Chinese, Japanese, and other non-Roman text languages for SQLite Database file created for e-Sword, the UTF encoding is set at UTF-16le.

What does all this mean? UTF stands for Unicode Transformation Format, and it comes in Three main flavors
  • UTF-8 which is Unicode Transformation Format - 8 bit, and is the primary setting for e-Sword/SQLite files.
  • UTF-16 which is Unicode Transformation Format - 16 bit, and is a large extension of UTF-8, and does more than UTF-8. There are two subcategories of UTF-16 which are UTF-16le (Unicode Transformation Format -16 bit Little Endian) and UTF-16be (Unicode Transformation Format Big Endian).
  • UTF-32 which is Unicode Transformation Format - 32 bit, and is also known as UTF 4 or Unicode version 4. This is basically the mother of all Unicode, and its huge. It also has the Little and Big Endian capability that UTF-16 has.
Basically all UTF does is its reads the Character Set of the language that has been set for the Database file, and the direction of which the text is to be displayed; if the text is Left to Right or Right to Left.

For example if the Language has been set by the reserved word HEBREW, and the direction of the text has been set as "1" (for Right to Left {see Details Table for these settings} ) then the UTF encoding will pick up this information, and it will read the code for the glyphs, and display the text in e-Sword.

B. RTF Code and Settings

Rich Text Formatting (a Microsoft invention) also has to be entered into the database in order for the text to be displayed with a particular formatting. Interesting to note, that e-Sword editors are Database file generators, and it inserts the RTF code for the format into the database file, and it reads that format. No RTF Code is stored inside e-Sword. All RTF code is placed in the Record of a particular Table of that database file.

Fonts, Font sizes, margins and etc, in the Editors are placed in their Database files. As where Bible Database files, I think are in Unicode, and are read by e-Sword.

OK, this actually ends this bit on e-Sword and Databases, of how they work. Although much of the information is quite technical, and may be somewhat difficult to understand, I trust this has been an interesting learning curve for you.

If you have SQLite Manager or SQLite Browser, open an e-Sword resource file in it, and explore it. Look at the different Tables, Fields and Records, look at the settings, note the code used in a Record Entry, and you'll see just how all that works in e-Sword. But before you play around with a file in SQLite, be sure to make a copy of it, so if you stuff it up, at least you'll have a copy to replace it.

Blessings,
Autograph.png
X (formerly Twitter)

 


#2 Marcela

Marcela

    New to Bible Support

  • Veterans
  • Pip
  • 1 posts
Offline

Posted 26 February 2017 - 08:08 PM

First of all, thank you for helping to develop this wonderful tool. I am not sure if you are the go-to person for this question, but you seem to know quite a lot about e-sword, that's why I hope you can help me.

 

I want to copy and paste two parallel translations in Excel (ESV and RV1960-T, Spanish) to later create a TM (translation memory) that I can later use when translating from English into Spanish. When I paste the table, it changes the format and pastes one verse under each other, instead of each verse next to the corresponding one.

 

I will appreciate any help or hints you may have.  Thank you in advance.

 

Marcela (whose grandparents came to Uruguay from the Land of the Long White Cloud)



#3 Tj Higgins

Tj Higgins

    e-Sword Fanatic

  • Members (T)
  • PipPipPipPipPip
  • 1,465 posts
Offline

Posted 26 February 2017 - 09:05 PM

First of all, thank you for helping to develop this wonderful tool. I am not sure if you are the go-to person for this question, but you seem to know quite a lot about e-sword, that's why I hope you can help me.

 

I want to copy and paste two parallel translations in Excel (ESV and RV1960-T, Spanish) to later create a TM (translation memory) that I can later use when translating from English into Spanish. When I paste the table, it changes the format and pastes one verse under each other, instead of each verse next to the corresponding one.

 

I will appreciate any help or hints you may have.  Thank you in advance.

 

Marcela (whose grandparents came to Uruguay from the Land of the Long White Cloud)

 

E-Sword has a built in parallel function that can accessed via tab in the bible window you can have up to 8 bible translations display in this window/tab. the translations will display in side by side columns for easy comparison. There is also a compare tab in the bible window that allows for the comparison of individual bible verses from multiple translations. 



#4 Katoog

Katoog

    e-Sword Fanatic

  • Members (T)
  • PipPipPipPipPip
  • 1,289 posts
Offline

Posted 27 February 2017 - 12:35 AM

There is the range of characters in UTF-8 that are supported in Greek and Hebrew.
https://www.w3school...f_utf_greek.asp
https://www.w3school...punctuation.asp
https://www.w3school...diacritical.asp
http://www.fileforma...ic/utf8test.htm
http://www.fileforma...ew/utf8test.htm
(don't worry if your browser can't read a part of the Unicode blocks)

Greek is fully supported in UTF-8 and unpointed Hebrew except if you use rare symbols.
UTF-16 files are bigger then the UTF-8. And less compatible with most Bible-programs.

 


Restored Holy Bible 17 and the Restored Textus Receptus

https://rhb.altervis...rg/homepage.htm


#5 hpcolus

hpcolus

    New to Bible Support

  • Members
  • Pip
  • 6 posts
Offline

Posted 17 March 2017 - 09:59 PM

What database stores the booksnames in different languages?   I know the Books are numbered from 1 to 73, but I would like to get the books names.  Are those available in SQLite tables/database?



#6 APsit190

APsit190

    e-Sword Tools Developer

  • Members (T)
  • PipPipPipPipPip
  • 2,870 posts
  • LocationLand of the Long White Cloud (AKA New Zealand)
Offline

Posted 18 March 2017 - 08:15 PM



What database stores the booksnames in different languages?   I know the Books are numbered from 1 to 73, but I would like to get the books names.  Are those available in SQLite tables/database?

The database file which the Booknames is the localize.lanx which can be opened in SQLite Manager, Editor, or the main program. This file is secured as Read Only, and therefore cannot be edited.

 

Some information about the localize.lanx database file:

  • A Table for each of the Languages (29 Language Tables)

  • A Languages Table

  • An SQLite Plus License Table.

See attachment below of what the Language database file looks like.

 

Blessings,

Autograph.png

Attached Files


X (formerly Twitter)

 


#7 hpcolus

hpcolus

    New to Bible Support

  • Members
  • Pip
  • 6 posts
Offline

Posted 23 March 2017 - 10:39 AM

Thanks for the information.  but having the information encrypted for this type of module do't you think that defeats the pupose of "openess" of eSword? I have bibles in custom xml format and I would like to automate a conversion to e-Sword without using manually NTtooltip.  Besides knowing the booknames, I also nned the information of basic html tags in order to identify the books, the chapters, and the verses.  Do you know where that information is available in bible support?  I need also the same for creating commentary files, again without using NTtooltips.


Edited by hpcolus, 23 March 2017 - 11:49 AM.


#8 journey

journey

    Resource Builder

  • Members (T)
  • PipPipPipPipPip
  • 638 posts
  • LocationOklahoma
Offline

Posted 23 March 2017 - 03:21 PM

Thanks for the information.  but having the information encrypted for this type of module do't you think that defeats the pupose of "openess" of eSword? I have bibles in custom xml format and I would like to automate a conversion to e-Sword without using manually NTtooltip.  Besides knowing the booknames, I also nned the information of basic html tags in order to identify the books, the chapters, and the verses.  Do you know where that information is available in bible support?  I need also the same for creating commentary files, again without using NTtooltips.

 

What you want to do can't be done as far as I know. Let us know if you find a way.


Philippians 4:6-7 (KJV)
6 Be careful for nothing; but in every thing by prayer and supplication with thanksgiving let your requests be made known unto God. 7 And the peace of God, which passeth all understanding, shall keep your hearts and minds through Christ Jesus.

 


#9 APsit190

APsit190

    e-Sword Tools Developer

  • Members (T)
  • PipPipPipPipPip
  • 2,870 posts
  • LocationLand of the Long White Cloud (AKA New Zealand)
Offline

Posted 23 March 2017 - 08:03 PM



Thanks for the information.  but having the information encrypted for this type of module do't you think that defeats the pupose of "openess" of eSword? I have bibles in custom xml format and I would like to automate a conversion to e-Sword without using manually NTtooltip.  Besides knowing the booknames, I also nned the information of basic html tags in order to identify the books, the chapters, and the verses.  Do you know where that information is available in bible support?  I need also the same for creating commentary files, again without using NTtooltips.

You can convert xml to csv (click here to download an xml to csv converter), and then import the csv file into SQLite Manager, and then from there save it as an SQLite database file. As to how well that will work I don't know. But you can always give it a go.

 

Blessings,

Autograph.png

X (formerly Twitter)

 


#10 hpcolus

hpcolus

    New to Bible Support

  • Members
  • Pip
  • 6 posts
Offline

Posted 24 March 2017 - 05:04 PM

Since I have a custom XML, a converter will just convert to custom tags.  It will convert to csv, but the tags that are recognized internally by e-Sword on the sqlite will not appear on the file, requiring a manual process to complete in NTtooltip.  As a programmer I think I will most likely generate a HTML to be imported to NTtooltip and then from there I will export to sqlite format.  If I had an official documentation of the "tags" that e-Sword understand and the bookname list and all possiblle abbreviations since I will be converting from two different languages directly into sqlite.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users




Similar Topics



Latest Blogs