[sword-devel] Remove Strong's references from KJV module
Troy A. Griffitts
scribe at crosswire.org
Sat Nov 14 22:59:53 EST 2020
Hi Loren,
There should be examples you can find under the examples/ folder in the source which output plain text, but there are 2 general ways to do this in SWORD:
1)
SWMgr library;
SWModule *kjv = library.getModule("KJV");
kjv->setKey("jn.3.16");
cout << kjv->stripText() << endl;
(see example: https://crosswire.org/svn/sword/trunk/examples/classes/simplechapter.cpp )
2) preferred:
SWMgr library(new MarkupFilterMgr(FMT_PLAIN));
SWModule *kjv = library.getModule("KJV");
kjv->setKey("jn.3.16");
cout << kjv->renderText() << endl;
(See example https://crosswire.org/svn/sword/trunk/examples/cmdline/outrender.cpp )
Hope this helps.
Welcome!
Troy
On November 14, 2020 8:35:06 PM MST, Loren Burkholder <computersemiexpert at outlook.com> wrote:
>I'm trying to get the plain text for a verse from the KJV module, but I
>can't figure out how to remove the Strong's references. I've tried
>adding a sword::GBFPlain and sword::GBFStrongs as a strip filter to my
>KJV module, but it only strips out the beginning of the <w> element,
>leaving me with stuff like:
>
>> salvm="strong:H072255">In the beginning
>
>as my output, instead of taking out the whole <w
>salvm="strong:H072255"> tag. What should I be doing to get rid of all
>this?
>
>Thanks in advance.
>Loren Burkholder
>
>
>_______________________________________________
>sword-devel mailing list: sword-devel at crosswire.org
>http://crosswire.org/mailman/listinfo/sword-devel
>Instructions to unsubscribe/change your settings at above page
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://crosswire.org/pipermail/sword-devel/attachments/20201114/48b447e9/attachment.html>
More information about the sword-devel
mailing list