[sword-devel] Detecting bad references?

Troy A. Griffitts scribe at crosswire.org
Mon Jan 11 10:39:42 MST 2016


If you'd like to see if a VerseKey was normalized for a module's
reference system, you can parse the reference with normalization off,
and then with it on and compare the keys to see if they are the the same.

vk2.setAutoNormalize(false);
vk1.setText("1Sam.2.200");
vk2.setText("1Sam.2.200");

cout << ((vk1==vk2) ? "no" : "") << " need for normalization\n";

I've added an example to the examples/ folder:

http://crosswire.org/svn/sword/trunk/examples/classes/versenorm.cpp


On 01/11/2016 08:52 AM, David Haslam wrote:
> Either during the process towards module build (in which it's often necessary
> to fix xrefs) or even subsequently,
> is it feasible for SWORD to test a reference to a specified versification
> and to respond with whether the reference is good or bad?
> 
> The question naturally follows on from my observation about a gotcha (just 1
> example) in the new FreDAW module.
> 
> NB. I was already aware of how SWORD handles a quirky reference like
> 1Sam.14.600,
> or even Gen.1.10000000  (but thanks for the reminder explanation, Karl).
> 
> If so, please explain how.
> 
> If not, is there an opportunity for an enhancement here?
> 
> David
> 
> 
> 
> 
> 
> 
> 
> --
> View this message in context: http://sword-dev.350566.n4.nabble.com/Detecting-bad-references-tp4655692.html
> Sent from the SWORD Dev mailing list archive at Nabble.com.
> 
> _______________________________________________
> 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
> 



More information about the sword-devel mailing list