[jsword-devel] SimpleOsisParser - parsing whole chapter refs

Martin Denham mjdenham at gmail.com
Sat Aug 30 12:05:17 MST 2014


I have taken a stab at adding the above functionality to SimpleOsisParser
so that it can also parse refs like 'Gen.1', 'Gen.1-Gen.3', 'Obad.1'.  I
would like to make the methods non-static but tried to make as few changes
as possible to the existing code but it may be that this enhancement
necessitates some refactoring.

Can somebody review the attached code and say if it is acceptable?

Martin


On 30 August 2014 15:23, Martin Denham <mjdenham at gmail.com> wrote:

> Hi,
>
> Are there any plans to extend the SimpleOsisParser to be able to parse
> chapter references like "Gen.1" instead of just verse references e.g.
> "Gen.1.1" or verse range references e.g. "Gen.1.1-Gen.1.3"?
>
> The following fails so I can't parse a reference to the whole of Genesis 1
> easily:
>
>         assertEquals("Gen.1", SimpleOsisParser.parseOsisRef(testV11n,
> "Gen.1").getOsisRef());
>
> other than by entering "Gen.1.1-Gen.1.31" which, funnily enough, returns
> the Osis I originally tried to enter "Gen.1".
>
> Martin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20140830/be32bb6c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SimpleOsisParser.java
Type: text/x-java
Size: 6012 bytes
Desc: not available
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20140830/be32bb6c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SimpleOsisIDParserTest.java
Type: text/x-java
Size: 4530 bytes
Desc: not available
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20140830/be32bb6c/attachment-0001.bin>


More information about the jsword-devel mailing list