The core responsibility of the passage package is to
store and collate information about the structure of the Bible - The most
important classes are Passage
, PassageTally
and Strongs
. A Passage
stores lists of
verses, for example"Gen 1:1-5, 10". PassageTally
is similar but stores verses ordered by
a tally against each verse. A Strongs
represents a Greek or Hebrew word as categorized by James Strong.
A Passage
is modeled
after the JDK 2.0 Collections
interface - so
all the usual add()
, remove()
type actions are available. (A PassageCollection
proxy class is available in order to treat a Passage
exactly like a Collection
)
In addition to this a Passage
will do:
Passage
. This will be of most use with a multi-threaded search
engine.
The Passage
interface
uses Verse
and VerseRange
in many of its methods. A Verse
is obvious - a single Bible verse e.g. "Exo 2:4", or "Jude 4". A VerseRange
has a start Verse and an end Verse
e.g. "Exo 3:5-7", or "Mat 25:1-Mar 2:4".
Verse
and VerseRange
have a superclass interface of VerseBase
, and this interface is collected and sorted
by Passage
.So an example Passage
is "Exo 2:4, 3:5-7, Mat
25:1-Mar 2:4, Jude 4".
The Passage
interface is
implemented by 3 concrete classes - DistinctPassage
is a simple sorted collection of Verse
s, RangedPassage
is a sorted
collection of VerseRange
s, and BitwisePassage
uses an array - essentially boolean[31104]
to specify whether a verse is a member
of the Passage
. Obviously each of these
implementations has different strengths, which the user should not need to be
bothered with. So the PassageFactory
class is
responsible for creating Passages
of a suitable
type.
The PassageTally
class
is-a to Passage
however it's job is to store a
rank to a Verse
. This is for a best-match type
application - "find the verse that best matches these words". It is my
intent to marry this with a Thesarus interface, because my most common gripe
with the OLB is that I search for "God & loves & world" and
expect to find John 3:16, but the search fails because John 3:16 uses the word
"loved" and not "loves".
The final aim is a fuzzy matching scheme to I can search for "God loves us and gave Jesus to save us" and correctly be told John 3:16.
The Strongs
class
represents a Hebrew or Greek word, or a parsing number indicating the way the
verse is aimed.
This package has a SelfTest
class that is designed to stress every line of code in the
rest of the package to make it bug-free. Otherwise this package is largely
complete. I still need to inspect [Bitwise|Distinct|Ranged]Passage and
PassageTally