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">&lt;<a href="mailto:westonruter@gmail.com">westonruter@gmail.com</a>&gt;</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&#39;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&#39;t duplicated too much of what SWORD has already for handling OSIS identifiers.<br>



<br>I&#39;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">&lt;<a href="mailto:scribe@crosswire.org" target="_blank">scribe@crosswire.org</a>&gt;</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">&lt;<a href="mailto:d.haslam@ukonline.co.uk" target="_blank">d.haslam@ukonline.co.uk</a>&gt;</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">&lt;<a href="mailto:Technical@tyndale.cam.ac.uk" target="_blank">Technical@tyndale.cam.ac.uk</a>&gt;</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, &quot;Am&quot; 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&#39;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&#39;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 &#39;en&#39; dash]<br>
Am 7.1-8.2<br>
Am 7.1 - 8.2<br>
etc<br>
<br>
There are so many &#39;standards&#39; 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&#39;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 &quot;a&quot; at the end of &quot;4Qp.Is&quot; 
is normally superscript)<br>
- normal numbers where possible (ie no Roman numerals but occasionally 
you need lower case letters)<br>
- no italics (&quot;Ant&quot; 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">&lt;<a href="mailto:d.haslam@ukonline.co.uk" target="_blank">d.haslam@ukonline.co.uk</a>&gt;</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, &quot;I&#39;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">&lt;<a href="mailto:greg.hellings@gmail.com" target="_blank">greg.hellings@gmail.com</a>&gt;</span><br>Date:
 Fri, Jun 18, 
2010 at 6:49 AM<br>To: SWORD Developers&#39; Collaboration Forum 
&lt;<a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a>&gt;<br></font><br></span><div class="im"><br>Personally I 
have a hyphen key I can push.  I don&#39;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">&lt;<a href="mailto:d.haslam@ukonline.co.uk" target="_blank">d.haslam@ukonline.co.uk</a>&gt;</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&#39;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">&lt;<a href="mailto:scribe@crosswire.org" target="_blank">scribe@crosswire.org</a>&gt;</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>