allalone747 wrote:
Thank you very much and yes I have the ambition to learn ,if I get the instructions and an example ,I will take your guidance.when this tree items are created with all the books of the Bible ,thousand of words won't this take ages to load up ,or will there be a way round the time span , thanks
Great that you have the ambition.
well we have to make an index. this can be done automatically upon first load.
so it will read the whole file once.
the index will look something like this. I am going to post this in easy to read then in python code
Code: Select all
Book:
Line Number: 50
Chapter:
Line Number: 52
Verse:
Line Number: 53
so we know the bible is written in a way that makes it easy to find specific passages
so if we "teach" python to read this index and when it finds specific identifiers to record the line number of that identifier to a file
and the file would look like this
Code: Select all
{
"Matthew": {
"line_no": 50,
"6": {
"line_no": 60,
"9": {
"line_no": 70
},
"10": {
"line_no": 71
},
"11": {
"line_no": 72
},
"12": {
"line_no": 73
},
"13": {
"line_no": 74
}
},
"Luke": {
AND SO ON AND SO FORTH
}
}
}
so when you tell it to find
"Book" Matthew
"Chapter" 6
"Verse" 9 through 13
it will look in it's index and queue up the first command which is Matthew
so it will bring up the index for Matthew. And if that was the only command then it would grab the line_no and bingo it goes from there.
but if it's not the only command then it will look for the next command under Matthew.... and so on and so forth
the nice thing about doing it this way would be that you can change the version of the bible you are using and it should still function as long as you delete the index file to the old one. that way it would have to recreate it.
Most bibles pretty much use the same syntax when it comes to the formatting.
now you could do this all manually if you like. writing down the line number for each and every passage. and making a macro and action for each one as well and then speaking the phrase for each one and putting the event in the macro.
but I am thinking you still want to be young

by time you finish. so we are going to have to key this out in code.