Details

    • Type: Improvement Improvement
    • Status: Open (View Workflow)
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7
    • Component/s: None
    • Labels:
      None

      Description

      A variant is an alternate given by another text.
      Only the primary should show.

      E.G. WHNU Mat 1.9

        Activity

        Hide
        DM Smith added a comment -

        Here is an email thread between Troy and Will on the subject.
        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; >> }

        >>

        Show
        DM Smith added a comment - Here is an email thread between Troy and Will on the subject. 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; >> } >>
        Hide
        DM Smith added a comment -

        I have fixed the problem of alternate readings showing up. Only the one that is x-class:1 will show.

        I am moving this to 1.1 because there is more that can be done. Specifically, the alternates should be displayed. This can either be done as if it were a note. Or it could be done as a "view" choice.

        Show
        DM Smith added a comment - I have fixed the problem of alternate readings showing up. Only the one that is x-class:1 will show. I am moving this to 1.1 because there is more that can be done. Specifically, the alternates should be displayed. This can either be done as if it were a note. Or it could be done as a "view" choice.
        Hide
        DM Smith added a comment -

        Fixed the problem of variants in OSIS files not showing up. Now ThML and OSIS produce the same representational input to xslt.

        The problem that remains is a front-end one.

        Show
        DM Smith added a comment - Fixed the problem of variants in OSIS files not showing up. Now ThML and OSIS produce the same representational input to xslt. The problem that remains is a front-end one.

          People

          • Assignee:
            Unassigned
            Reporter:
            DM Smith
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: