[sword-devel] engine reference parsing

Peter von Kaehne refdoc at gmx.net
Thu Nov 4 04:56:19 MST 2010


Many thanks Troy, that is a very helpful posting.

> Von: "Troy A. Griffitts" <scribe at crosswire.org>

> You should get no joy from using '.' as a list separator.  Currently the
> engine parser uses ':' and '.' as separators between chapter and verse.
> 
> Scope should work well in your examples if you change your punctuation
> to swap '.' for ',' and ',' for ':'.

I will experiment with this and come back to you.
>  I'm of the same mind that
> new modules should use osisRef syntax which explicitly specifies the
> list, range, and chap/verse divider character.  Then in the prose, the
> module can have anything they want, e.g.,
> 
> <reference osisRef="Ps.35.1 Ps.90.2 John.1.1">Ps 35,1;90,2;Joh
> 1,1;</reference>

I fully agree and this is what I am trying to achieve. My difficulty is in creating the proper OSIS references. But, I think i am getting there.

 
> But currently we just throw anything at the parse and it will try to use
> your currently locale AND the English locale to parse reference or
> osisRef.  osisRef and German, for example, if we localize the '.' as the
> list separator, will no longer live happily together.

Is this why we have weird behaviour in Xiphos (and possibly other places too, butI have not checked) when references do not contain an OSIS ref?

<note type="crossReference"><reference>Apg 7,14</reference><note>

This should to my mind not get parsed but simply be presented as a plain "not "clickable" text "Apg 7,14". 

It should be up to the module maker to create proper crossreferences in correct OSIS marking up and should not be the engine's job at the rendering time to present a nice "clickable" out of poor input. Otherwise we will get all kinds of mess - as we do already in a variety of modules.

But - and I think this is where the engine comes in - any enhancements on the parsing engine during module builds are hugely useful. As they are to decipher user input. 

Peter

 

> 
> Noted.  On my list to think about.  Thanks for the input.
> 
> Troy
> 
> 
> 
> On 11/04/2010 09:01 AM, Peter von Kaehne wrote:
> > A recent thread referred to some necessary/useful enhancements.
> > 
> > Here are a couple of cases which get currently handled badly and would
> > be really useful if handled correctly:
> > 
> > 1) lists of verses within the current scope
> > 
> > V. 6.9.11.14;V. 20.24.26;V. 29;
> > 
> > Trying to parse this with (in Perl)
> > 
> >> Sword::VerseKey::convertToOSIS($_, $scope)
> > 
> > results in only the last reference being recognised but all initial ones
> > being ignored or are read as Rev.22.21 depending on what separation
> > markers I use.
> > 
> > 2) several references from same book in row:
> > 
> > Ps 35,1;90,2;Joh 1,1;
> > 
> > The middle Psalm 90.2 is not recognised.
> > 
> > Peter
> > 
> > _______________________________________________
> > sword-devel mailing list: sword-devel at crosswire.org
> > http://www.crosswire.org/mailman/listinfo/sword-devel
> > Instructions to unsubscribe/change your settings at above page
> 
> 
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page

-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail



More information about the sword-devel mailing list