[sword-devel] WHNU variants
Troy A. Griffitts
scribe at crosswire.org
Sun May 15 01:56:40 MST 2005
Will, that almost looks alright. The options are:
All Readings
Primary Reading
Secondary Reading
note the plural/singular difference.
You might want to just grab the available feature set and valid choices
from the engine, which is how most frontends (besides Bibletime :) ) use
the engine. Here is a code snippet from BibleCS:
StringList options = mainmgr->getGlobalOptions();
for (StringList::iterator it = options.begin(); it !=
options.end(); it++) {
TMenuItem *newitem = new TMenuItem(MainMenu1);
newitem->Caption = it->c_str();
newitem->Default = false;
newitem->OnClick = OptionShowVals;
newitem->Hint = mainmgr->getGlobalOptionTip(it->c_str());
StringList values = mainmgr->getGlobalOptionValues(it->c_str());
for (StringList::iterator it2 = values.begin(); it2 !=
values.end(); it2++) {
TMenuItem *newitem2 = new TMenuItem(MainMenu1);
newitem2->Caption = it2->c_str();
newitem2->Default = false;
newitem2->OnClick = GlobalOptionChange;
newitem->Add(newitem2);
}
// optionsMenu->Add(newitem);
}
The first variant is in Matthew 1:9.
<seg type="x-variant" subType="x-class:1">
<w morph="Robinson:N-PRI" lemma="strong:G881">αχας</w>
<w morph="Robinson:N-PRI" lemma="strong:G881">αχας</w>
</seg>
<seg type="x-variant" subType="x-class:2">
<w morph="Robinson:N-PRI" lemma="strong:G881">αχαζ</w>
<w morph="Robinson:N-PRI" lemma="strong:G881">αχαζ</w>
</seg>
(that's the OSIS rendering)
It's not a typo, though it looked to me like one, at first. The name
Achaz (or Achas) is repeated twice (... begat Achaz, Achaz begat ...)
You'd modify thmlhtmlhref filter to add the code I gave you in my last
message to handle the ThML and output something useful for you.
Hope this helps,
-Troy.
Will Thimbleby wrote:
> Great, thanks. I'm using a modified BibleTime filter at the moment. I'm
> not sure I understand which filters do what. This is what I got from
> diatheke -- is this right?
>
>
> if (optionfilters & OP_VARIANTS && variants) {
> if (variants == -1)
> manager.setGlobalOption("Variants", "All Readings");
> else if (variants == 1)
> manager.setGlobalOption("Variants", "Secondary Readings");
> }
> else
> manager.setGlobalOption("Transliteration", "Primary Readings");
>
>
>
> What would also be very handy is if you could point me at a verse that
> has variants in WHNU and, even better, what I should be showing for
> that verse.
>
> thanks for the info -Will
>
> On 14 May 2005, at 10:11 pm, Troy A. Griffitts wrote:
>
>> Will,
>> There are 3 options for displaying variants in WHNU: Primary
>> Reading, Secondary Reading, and Both.
>>
>> The first 2 get done at the filter level in the sword engine.
>> The user selects the option just like any other option (not sure how
>> users select sword options in MacSword). The last one will send both
>> words to you and will look funny if they aren't marked up
>> differently. I'd have to know what filter you are using for ThML
>> rendering. Anyway, here is an excerpt of code from the thmlosis
>> filter that catches them when converting thml to osis. You can
>> probably use this same logic and replace:
>> <seg type="x-variant" subType="x-class:1">word in WH</seg>
>> <seg type="x-variant" subType="x-class:2">word in NU</seg>
>>
>> with something like: <u>word in NU</u> (alt: word in WH)
>> I'm sure you'll come up with something a little more asthetically
>> pleasing, as you are the master of all such :)
>>
>> Here's the code snippet:
>>
>> // variants
>> if (!strncmp(token, "div type=\"variant\"", 18)) {
>> XMLTag tag = token;
>> text.append("<seg type=\"x-variant\"");
>> SWBuf cls = "x-class:";
>> cls += tag.getAttribute("class");
>> if (cls.length()>8)
>> text.appendFormatted(" subType=\"%s\"",
>> cls.c_str());
>>
>> text += ">";
>> divEnd = "</seg>";
>> newText = true;
>> lastspace = false;
>> handled = true;
>> }
>>
>>
>> Will Thimbleby wrote:
>>
>>> Hi, can some one point me to some variants in the WHNU module,
>>> along with what MacSword should be showing. So I can fix MacSwords
>>> variant code.
>>> thanks --Will
>>> _______________________________________________
>>> 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
>>
>
> _______________________________________________
> 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