[osis-users] osisRef Grains
Todd Tillinghast
todd at snowfallpress.com
Wed Jun 30 13:53:30 MST 2010
Weston,
Standard references (ones that don't use either @ or !) are general to
all works that conform to a specified reference system.
The use of @cp(2) inidcates a reference to the second code point within
a verse. Counted as the number of characters in text elements that
follow either the <verse osisID="Matt.1.1" sID="X"/> in a
Book/Section/Paragraph hierarchy document OR the <verse
osisID="Matt.1.1"> in a pure Book/Chapter/Verse hierarchy document.
So if you have the following:
<osisText osisIDWork="thisWork" osisRefWork="bible" xml:lang="erv">
<header>
<work osisWork="thisWork">
<title>(Publications) Easy-to-Read Version</title>
<creator role="encoder">Snowfall Software, LLC</creator>
<description type='usfm' subType='x-id'>MAT - Copyright
World Bible Translation Center 1987, 1999, 2006, 2008</description>
<description type='usfm' subType='x-ide'>UTF-8</description>
<type type="OSIS">Bible</type>
<identifier type="OSIS">Bible.en.WBTC.erv.2007</identifier>
<rights type="x-copyright">World Bible Translation
Center</rights>
<scope>Matt</scope>
<refSystem>Bible</refSystem>
</work>
<work osisWork="bible">
<creator role="encoder">Snowfall Software, LLC</creator>
<type type="OSIS">Bible</type>
<refSystem>Bible</refSystem>
</work>
</header>
<div type="book" osisID="Matt"><title type="main" short="MATTHEW"
level="1">Matthew</title><chapter sID="Matt.1" osisID="Matt.1"/>
<div type="section" scope="Matt.1.1-Matt.1.17"
xml:space="preserve"><title>The Family History of Jesus the
Messiah<title type="parallel">(<reference
osisRef="Luke.3.23!b-Luke.3.38">Lk.
3:23b--38</reference>)</title></title><p><verse sID="Matt.1.1"
osisID="Matt.1.1"/>This is the family history of Jesus the Messiah.<note
placement="end" osisRef="Matt.1.1"
osisID="Matt.1.1!endNote.1"><catchWord>Messiah</catchWord> A Hebrew word
that has the same meaning as the Greek word Christ (see "Christ"). It
was a title for the kings of God's people in the Old Testament and for
the special king God promised to send as a "savior" to defeat evil and
establish the reign of God. Many prophets made it clear that this new
kingdom would be eternal; that is, not only would the promised Messiah
bring about a time of justice and right living among God's people here
on earth, but also his kingdom would extend beyond this world to life
forever with God. However, most Jews of the first century expected the
Messiah to be a political ruler here on earth who would defeat the other
nations and return the nation of Israel to a position of great glory and
power. But God intended his Messiah to establish a new "Israel," an
eternal kingdom that would bless all the nations.</note> He came from
the family of David, .........
A reference to osisRef="Matt.1.1 at cp[1]-Matt.1.1 at cp[18]" would include
"This is the family" and a reference to Matt.1.1 at cp[1]-Matt.1.1 at cp[61]
would include "This is the family history of Jesus the Messiah. He came
from" because the counting only include elements that are
canonical="true". The general default for canonical is "true" but it is
false by default for <note> and <title>. In some cases (primarrly in
Psalms the <title> element is canonical and is specifically marked as such).
Another way to express the same thing is to use the string grain.
A reference to osisRef="Matt.1.1 at s[This]-Matt.1.1 at s[faimly]" (or
osisRef="Matt.1.1 at s[This][1]-Matt.1.1 at s[faimly][1]") would include "This
is the family" and a reference to "Matt.1.1 at s[This]-Matt.1.1 at s[from]"
would include "This is the family history of Jesus the Messiah. He came
from".
osisRef="Matt.1.1 at s[This][1]-Matt.1.1 at s[the][2]" would include "This is
the family history of Jesus the Messiah. He came from the" and
osisRef="Matt.1.1 at s[This][1]-Matt.1.1 at s[the][1]" would include "This is
the".
There is a specific difference between what gets printed as a "letter"
on screen on paper and the code points counted in that in some scripts
there can be multiple code points that make up a single displayed
"letter". In English this does not occur.
Todd
This is the family history of Jesus the Messiah. He came from the family
of David,
Weston Ruter wrote:
> Can someone explain this regular expression for the osisRef grains?
>
> (@(cp\[(\p{Nd})*\]|s\[(\p{L}|\p{N})+\](\[(\p{N})+\])?))?
>
> The OSIS manual says that a grain is in the form of:
>
> grainType(parameters)
>
>
> And provides the example:
>
> Matt.1.1 at cp(3)-Matt.1.1 at cp(12)
>
>
> But elsewhere the format is shown to be:
>
> Gen.1.1 at cp[8]
>
>
> I'm assuming that the parentheses are wrong, and the square brackets
> are right.
>
> Furthermore, looking at the cp grain: cp\[(\p{Nd})*\]
>
> Why does it allow zero or more digits to be supplied as the parameter
> and not one or more? i.e. cp\[(\p{Nd})+\]. Otherwise I could do
> John.3 at cp[] and I don't think that should be allowed.
>
> Now for the s grain: s\[(\p{L}|\p{N})+\](\[(\p{N})+\])?
>
> I can see that that it is similar to cp, but that the parameter can be
> not just a decimal digit but any unicode number or letter. What I
> don't get is what comes after this, namely: (\[(\p{N})+\])? What's
> with this secondary square-bracket-enclosed Unicode number? The s
> grain regular expression would allow something like this: s[John][12],
> but there's no example of this in the manual. Is this supposed to mean
> that it would select the 12th instance of "John"?
>
> Thanks!
> Weston
> ------------------------------------------------------------------------
>
> _______________________________________________
> osis-users mailing list
> osis-users at crosswire.org
> http://www.crosswire.org/mailman/listinfo/osis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/osis-users/attachments/20100630/926c2eba/attachment.html>
More information about the osis-users
mailing list