Bible Searching

Devin Asay devin_asay at byu.edu
Thu Jan 12 17:18:27 EST 2006


Having done similar things (though not on this scale) in Rev I can  
second Sarah's suggestions. In your sample text I noticed that were  
several verses in a single paragraph. If that arrangement is not  
important, I would recommend you put each verse on a single logical  
line (i.e., each verse delimited by a return. That will ease your  
task considerably. Then, once you found the desired chapter you could  
be confident that each verse was on its own line. So line 4 would  
contain verse 4, line 7 verse 7, and so on.

Devin


On Jan 12, 2006, at 2:27 PM, Sarah Reichelt wrote:

>>  Hello again everyone! I come to you today in reference to a  
>> project  I've
>> been working on lately. I'm trying to make a bible studying  
>> program. I have  the
>> books of the bible in TXT files in a folder (Just managing that was a
>> task...). I wanted to add the ability to look up verses  
>> individually,  but the way
>> the bible text is set up in those TXT files I'm having trouble   
>> figuring out
>> how to accomplish that. Here is an example of the way the  books  
>> are formatted
>> consistently in TXT files (According by book):
>>
>>     Genesis 1:1-31
>>
>> 1 In [the] beginning God created the heavens and the earth.
>>
>> 2 Now the earth proved to be formless and waste and there was  
>> darkness  upon
>> the surface of [the] watery deep; and God's active force was  
>> moving to and
>> fro over the surface of the waters.


>
> I guess it all depends on how the text files are set up and changing
> them to make it easier to search may be the quickest way in the long
> run. I would arrange it so that each book had it's own text file, so
> you would have "Genesis.txt", "John.txt" etc.
>
> When a search is done, you can load the correct text file quickly and
> store it's text in a variable. Then you can get use lineOffset to find
> the start of the chapter:
>
> put lineOffset(bookName && chapterNum & ":", tBookText) into  
> tStartLine
>
> This gives you the starting point for the verse number search:
>
> put lineOffset(cr & verseNum & space, tBookText, tStartLine) into  
> tVerseLine
> put tVerseLine + tStartLine into tVerseStartLineNumber
>
> Then you want to find where that verse ends. You could do another
> lineOffset looking for the next verse number, and go to the end of the
> chapter if the next verse number can't be found, or you could step
> through the lines looking for the next blank line and stopping there.
>
> You may find that it is better to give people a stuctured way to enter
> the search data rather than allowing free typing. Have a menu system
> for selecting a book name, then a field with little arrows for
> choosing chapter numbers and verse numbers. If you have already worked
> out how many chapters each book has and how many verses each chapter
> has, you can restrict the search data entry to numbers that are really
> available.
>
> Hopefully this has given you enough ideas to get started.
>
> Cheers,
> Sarah
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University




More information about the use-livecode mailing list