The source code for the reference parser lives mostly in src/keys/versekey.cpp:ParseVerseList in the sword source code.<br><br>Though it does work quite well, it has a number of problems and is very hard to maintain/add new features to.<br>
<br clear="all">God Bless,<br>Ben<br>-------------------------------------------------------------------------------------------<br>Multitudes, multitudes,<br> in the valley of decision!<br>For the day of the LORD is near<br>
in the valley of decision.<br><br>Giôên 3:14 (ESV)<br><br>
<br><br><div class="gmail_quote">On Sat, Jun 19, 2010 at 5:15 AM, Weston Ruter <span dir="ltr"><<a href="mailto:westonruter@gmail.com">westonruter@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr">Troy, This is great! Where's the source code for the reference parser?<br>
<br>
As part of the Open Scriptures osis.py module for representing OSIS identifier objects
(osisID, osisRef, osisWork, etc), the next step is to have a
pluggable/extensible system for converting human-formatted references
into their OSIS equivalents, and also to go in the reverse: converting any OSIS object into a localized human-friendly representation. Collaboration between SWORD and Open Scriptures would obviously be a win. That being said, hopefully I haven't duplicated too much of what SWORD has already for handling OSIS identifiers.<br>
<br>I've got OsisWork, OsisPassage, and OsisID classes assembled so far: <a href="http://github.com/openscriptures/api" target="_blank">http://github.com/openscriptures/api</a><br>See tests for how the objects can be used: <a href="http://github.com/openscriptures/api/blob/a73bdd7d267b70a9e1303a3205c4241f52d3a83e/osis.py#L763" target="_blank">http://github.com/openscriptures/api/blob/a73bdd7d267b70a9e1303a3205c4241f52d3a83e/osis.py#L763</a><br>
<br>Weston<br><br><br><div class="gmail_quote"><div class="im">On Fri, Jun 18, 2010 at 11:58 AM, Troy A. Griffitts <span dir="ltr"><<a href="mailto:scribe@crosswire.org" target="_blank">scribe@crosswire.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Regarding what we accept currently, you can try experimenting with:<br>
<br>
<a href="http://crosswire.org/study/examples/parsevs.jsp" target="_blank">http://crosswire.org/study/examples/parsevs.jsp</a><br>
<br>
<br>
We do have the ability to provide alternate versification schemes which<br>
include other books (e.g., apoc.), or completely different book names<br>
like a versification of Josephus or DSS, but this tool defaults to the<br>
Protestant KJV v11n.<br>
<font color="#888888"><br>
Troy<br>
</font><div><br></div></blockquote></div><div><br><br><div class="gmail_quote"><span style="font-size: large; font-weight: bold;">Forwarded
conversation</span><br>Subject: <b class="gmail_sendername">[sword-devel]
Non-Anglophone Bible references</b><br>------------------------<br><br><span><font color="#000000">From: <b>David
Haslam</b> <span dir="ltr"><<a href="mailto:d.haslam@ukonline.co.uk" target="_blank">d.haslam@ukonline.co.uk</a>></span><br>Date:
Thu, Jun 17, 2010 at 1:58 PM<br>To: <a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a><br></font><br></span><div class="im"><br><br>
Tim Bulkeley has written a short item on this topic here.<br>
<br>
<a href="http://bigbible.org/sansblogue/bible/non-anglophone-bible-references/%0ANon-Anglophone" target="_blank">http://bigbible.org/sansblogue/bible/non-anglophone-bible-references/<br>
Non-Anglophone</a> Bible references<br>
<br>
The topic arises out of his frustration at having to perform a massive<br>
search and replace task to submit an article to a certain European<br>
theological journal.<br>
<br>
As many CrossWire developers are Anglophone, this may prompt some
further<br>
thoughts that could benefit all our projects.<br>
<br></div>
David<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://sword-dev.350566.n4.nabble.com/Non-Anglophone-Bible-references-tp2259480p2259480.html" target="_blank">http://sword-dev.350566.n4.nabble.com/Non-Anglophone-Bible-references-tp2259480p2259480.html</a><div class="im">
<br>
Sent from the SWORD Dev mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br></div><div class="im">
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/sword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br>
</div></font><br>----------<br><span><font color="#000000">From:
<b>David Instone-Brewer</b> <span dir="ltr"><<a href="mailto:Technical@tyndale.cam.ac.uk" target="_blank">Technical@tyndale.cam.ac.uk</a>></span><br>Date:
Fri, Jun 18, 2010 at 2:42 AM<br>To: <a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a><br></font><br></span><div class="im"><br>Tim
has over-simplified the situation.<br>
Other systems include different ways of abbreviating the books.<br>
In the following, "Am" is an abbreviation which does not include the end
of the word,<br>
while Jas (ie James) does include the end of the word, so it shouldn't
have a dot after it,<br>
which results in different systems:<br>
<br>
Am.7 and Jas 1<br>
Am.7 and Jas.1<br>
Am. 7 and Jas 1<br>
Am. 7 and Jas. 1<br>
<br>
Also, in numbering, the Dead Sea Scrolls have re-popularised the use of
dots instead of colons, ie<br>
<br>
Am 7.1-3, 4-5<br>
<br>
And we haven't dealt with variations in listing other chapters<br>
<br>
Am 7.1-3; 8.1-2<br>
Am 7:1-3. 8:1-2<br>
etc<br>
<br>
And then we have the problem of references which span a chapter:<br>
<br>
Am 7.1--8.2 [or use an 'en' dash]<br>
Am 7.1-8.2<br>
Am 7.1 - 8.2<br>
etc<br>
<br>
There are so many 'standards' that it is best simply to pick the one
which works best for you and stick to it.<br>
<br></div><div class="im">
I'd suggest the following is the best compromise between humans and
people.<br>
<br></div><div class="im">
Amo 7.1-2; 8.1-2--9.2: Thus says the Lord....<br>
Jos Ant 1.2.15: On this day...<br>
1QS 3.1<br>
4Q496 2.6.1<br>
4Qp.Is.a 1.1<br>
b.San 15.a-b [this means folio 15, sides a and b]<br>
<br>
This uses:<br>
- no dots but a space after the abbreviation of the title of the work<br>
- preceding dot instead of superscript (the "a" at the end of "4Qp.Is"
is normally superscript)<br>
- normal numbers where possible (ie no Roman numerals but occasionally
you need lower case letters)<br>
- no italics ("Ant" is normally in italic, as a non-Biblical book title)<br>
- 3-letter Bible book abbreviation (preferably the same as that used by
BibleWorks and others)<br>
- dots dividing between verses, chapters, books and any other levels of
division.<br>
- single hyphen for spans of verses<br>
- double hyphen for spans of chapters<br>
- semi-colon for separate references<br>
- colon used to separate a reference from the content<br>
<br>
<br>
David IB<br></div>----------<br><span><font color="#000000">From:
<b>David Haslam</b> <span dir="ltr"><<a href="mailto:d.haslam@ukonline.co.uk" target="_blank">d.haslam@ukonline.co.uk</a>></span><br>Date:
Fri, Jun 18,
2010 at 6:37 AM<br>To: <a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a><br></font><br></span><div class="im"><br><br>
I was somewhat amused by the sentence that reads, "I'd suggest the
following<br></div><div class="im">
Notwithstanding, should spans of verse be punctuated by a hyphen or by
the<br>
ndash character?<br>
<br></div><div class="im">
cf. I came across a tip for MS-Word yesterday which claimed that the
ndash<br>
is the proper standard for numerical ranges.<br>
<br>
Methinks such a change would be abhorrent to a lot of Bible software!<br>
<br></div>
David<br>
<font color="#888888">--<br>
View this message in context: <a href="http://sword-dev.350566.n4.nabble.com/Non-Anglophone-Bible-references-tp2259480p2260214.html" target="_blank">http://sword-dev.350566.n4.nabble.com/Non-Anglophone-Bible-references-tp2259480p2260214.html</a><br>
</font><br>----------<br><span><font color="#000000">From:
<b>Greg Hellings</b> <span dir="ltr"><<a href="mailto:greg.hellings@gmail.com" target="_blank">greg.hellings@gmail.com</a>></span><br>Date:
Fri, Jun 18,
2010 at 6:49 AM<br>To: SWORD Developers' Collaboration Forum
<<a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a>><br></font><br></span><div class="im"><br>Personally I
have a hyphen key I can push. I don't have an ndash key<br>
I can push. I vote for hyphens!<br>
<br></div>----------<br><span><font color="#000000">From: <b>David Haslam</b> <span dir="ltr"><<a href="mailto:d.haslam@ukonline.co.uk" target="_blank">d.haslam@ukonline.co.uk</a>></span><br>Date:
Fri, Jun 18,
2010 at 7:03 AM<br>To: <a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a><br></font><br></span><div class="im"><br><br>
Perhaps more to the point for CrossWire developers, should we create a
new<br>
wiki page to address this subject?<br>
<br>
Within David IB's examples, which of these are not valid references in<br>
relation to our software?<br>
<br>
Assuming we could [eventually] make use of any of these referenced
biblical<br>
texts within the SWORD API, i.e. even those for the Dead Sea Scrolls,
etc.<br>
<br>
David<br>
</div><font color="#888888">--<div class="im"><br>
View this message in context: <a href="http://sword-dev.350566.n4.nabble.com/Non-Anglophone-Bible-references-tp2259480p2260248.html" target="_blank">http://sword-dev.350566.n4.nabble.com/Non-Anglophone-Bible-references-tp2259480p2260248.html</a><br>
</div></font><br>----------<br><span><font color="#000000">From:
<b>Troy A. Griffitts</b> <span dir="ltr"><<a href="mailto:scribe@crosswire.org" target="_blank">scribe@crosswire.org</a>></span><br>Date:
Fri, Jun 18, 2010
at 11:58 AM<br>To: <a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a><br></font><br></span><div class="im"><br>Regarding
what we accept currently, you can try experimenting with:<br>
<br>
<a href="http://crosswire.org/study/examples/parsevs.jsp" target="_blank">http://crosswire.org/study/examples/parsevs.jsp</a><br>
<br>
<br>
We do have the ability to provide alternate versification schemes which<br>
include other books (e.g., apoc.), or completely different book names<br>
like a versification of Josephus or DSS, but this tool defaults to the<br>
Protestant KJV v11n.<br>
<font color="#888888"><br>
Troy<br>
</font><br></div></div>
<br>
<br></div></div></div>
<br>_______________________________________________<br>
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/sword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br></blockquote></div><br>