[sword-devel] How to detect books available in a given module ?

David Haslam dfhdfh at protonmail.com
Tue May 15 10:30:08 MST 2018


Hi Pierre,

Aside: It might be useful to outline the context for which you require that data.

You might just wish to consider using the Sword utility emptyvss.

This outputs a list of all the references in the module that have no content.

The processing is in relation to the Versification defined in the module, or to the default KJV versification if not specified in the .conf file.

If whole books are missing, then of course, there will be a line in the output for every verse in each such book.


​Best regards,

David

Sent with ProtonMail Secure Email.​

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On 15 May 2018 2:47 PM, Pierre Amadio <amadio.pierre at gmail.com> wrote:

> Hello.
> 
> I am trying to be able to detect wich books are available in a given
> 
> module.
> 
> I do not experience a consistent behaviour with all modules, and I am
> 
> wondering if there is a bug somewhere, or if my expectations are wrong.
> 
> I was expecting the SWModule Error() method to be a good way to detect
> 
> an unknown verse once the versekey was set, by example like this:
> 
> SWMgr library(new MarkupFilterMgr(FMT_PLAIN));
> 
> SWModule * target;
> 
> const char *moduleName="KJV";
> 
> const char *keyName="Genesis 1:1";
> 
> target = library.getModule(moduleName);
> 
> target->setKey(keyName);
> 
>     char e=target->Error();
>     
> 
> if(e) {
> 
> //There is an error,no such book in this module.
> 
> printf("Error: %c \n", target->Error());
> 
>         std::cout<< "Error:"<<target->Error()<<"\n";
>     
>     } else {
>         std::cout << target->getKeyText() << "\n";
>     
>         std::cout << target->renderText();
>     
>     }
>     
> 
> Things works like expected if i use "OSHB" as a module and "Mark 1:1" as
> 
> keyName: there is an error and i can realise this module does not
> 
> contain the book of Mark. However, when dealing with some greek module
> 
> such as MorphGNT or Nestle1904 and using "Genesis 1:1" as keyName, there
> 
> is no error detected although those modules do not contains the book of
> 
> genesis.
> 
> Any idea what i may be doing wrong and how to detect wich modules gives
> 
> wich book ?
> 
> 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