<div style="font-family: Arial, sans-serif; font-size: 14px;">Hi Tobias,</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">My search results were with <span><b>xiphos.exe 4.2.1 (gtk2 webkit1)</b></span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">There are <b>14</b> verses in which the word occurs <b>more than once</b>:</div><blockquote style="border-left: 3px solid rgb(200, 200, 200); border-top-color: rgb(200, 200, 200); border-right-color: rgb(200, 200, 200); border-bottom-color: rgb(200, 200, 200); padding-left: 10px; color: rgb(102, 102, 102);"><div style="font-family: Arial, sans-serif; font-size: 14px;">Acts 3:16: And his name through <b>faith</b> in his name hath made this man strong, whom ye see and know: yea, the <b>faith</b> which is by him hath given him this perfect soundness in the presence of you all.<div>Romans 1:17: For therein is the righteousness of God revealed from <b>faith</b> to <b>faith</b>: as it is written, The just shall live by <b>faith</b>.</div><div>Romans 3:30: Seeing it is one God, which shall justify the circumcision by <b>faith</b>, and uncircumcision through <b>faith</b>.</div><div>Romans 4:16: Therefore it is of <b>faith</b>, that it might be by grace; to the end the promise might be sure to all the seed; not to that only which is of the law, but to that also which is of the <b>faith</b> of Abraham; who is the father of us all,</div><div>Romans 14:23: And he that doubteth is damned if he eat, because he eateth not of <b>faith</b>: for whatsoever is not of <b>faith</b> is sin. </div><div>II Corinthians 1:24: Not for that we have dominion over your <b>faith</b>, but are helpers of your joy: for by <b>faith</b> ye stand. </div><div>Galatians 2:16: Knowing that a man is not justified by the works of the law, but by the <b>faith</b> of Jesus Christ, even we have believed in Jesus Christ, that we might be justified by the <b>faith</b> of Christ, and not by the works of the law: for by the works of the law shall no flesh be justified.</div><div>Galatians 3:23: But before <b>faith</b> came, we were kept under the law, shut up unto the <b>faith</b> which should afterwards be revealed.</div><div>Philippians 3:9: And be found in him, not having mine own righteousness, which is of the law, but that which is through the <b>faith</b> of Christ, the righteousness which is of God by <b>faith</b>:</div><div>I Timothy 1:19: Holding <b>faith</b>, and a good conscience; which some having put away concerning <b>faith</b> have made shipwreck:</div><div>Hebrews 11:7: By <b>faith</b> Noah, being warned of God of things not seen as yet, moved with fear, prepared an ark to the saving of his house; by the which he condemned the world, and became heir of the righteousness which is by <b>faith</b>.</div><div>James 2:14: What doth it profit, my brethren, though a man say he hath <b>faith</b>, and have not works? can <b>faith</b> save him?</div><div>James 2:18: Yea, a man may say, Thou hast <b>faith</b>, and I have works: shew me thy <b>faith</b> without thy works, and I will shew thee my <b>faith</b> by my works.</div><div>James 2:22: Seest thou how <b>faith</b> wrought with his works, and by works was <b>faith</b> made perfect?</div></div></blockquote><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div>
<div class="protonmail_signature_block" style="font-family: Arial, sans-serif; font-size: 14px;">
    <div class="protonmail_signature_block-user">
        Best regards,<br><br>David
    </div>
    <div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div>
    <div class="protonmail_signature_block-proton">
        Sent with <a target="_blank" href="https://proton.me/mail/home">Proton Mail</a> secure email.
    </div>
</div>
<div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div class="protonmail_quote">
        On Saturday, March 1st, 2025 at 9:09 AM, Tobias Klein <contact@tklein.info> wrote:<br>
        <blockquote class="protonmail_quote" type="cite">
            
    <p>Hi David,</p>
    <p>when I perform a Lucene search for "faith" in the KJV with Xiphos
      4.2.1 on Linux I get 341 results.<br>
      When I perform an exact phrase search with the same environment I
      get 338 results (exactly like in Ezra after the bugfix).<br>
      <br>
      Best regards,<br>
      Tobias<br>
    </p>
    <div class="moz-cite-prefix">On 3/1/25 09:45, David Haslam wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div style="font-family: Arial, sans-serif; font-size: 14px;">Hi
        Tobias,</div>
      <div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
      </div>
      <div style="font-family: Arial, sans-serif; font-size: 14px;">A
        Lucene search for 'faith' in the KJV module using <b>Xiphos</b>
        returns 231 locations.<br>
        <span style="display: inline !important; background-color: rgb(255, 255, 255);"><u>Aside</u>:
          Only 2 of these locations are in the OT !!!</span></div>
      <div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
        I'm sure there are verses that have the word repeated, as the <b>whole
          word</b> occurs 247 times.</div>
      <div style="font-family: Arial, sans-serif; font-size: 14px;">(Search
        results from the plain text file output by <b>diatheke</b>)</div>
      <div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
      </div>
      <div style="font-family: Arial, sans-serif; font-size: 14px;">If
        one drops the <b>whole word</b> criterion, the total leaps to
        362, as words such as 'faithful', 'faithfulness', 'faithless',
        etc., are then included.</div>
      <div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
      </div>
      <div style="font-family: Arial, sans-serif; font-size: 14px;" class="protonmail_signature_block">
        <div class="protonmail_signature_block-user"> Best regards,<br>
          <br>
          David </div>
        <div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
        </div>
        <div class="protonmail_signature_block-proton"> Sent with <a href="https://proton.me/mail/home" target="_blank" rel="noreferrer nofollow noopener">Proton Mail</a> secure email. </div>
      </div>
      <div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
      </div>
      <div class="protonmail_quote"> On Saturday, March 1st, 2025 at
        7:09 AM, Tobias Klein <a href="mailto:contact@tklein.info" class="moz-txt-link-rfc2396E" rel="noreferrer nofollow noopener"><contact@tklein.info></a> wrote:<br>
        <blockquote type="cite" class="protonmail_quote">
          <p>Hi Troy,</p>
          <p>can this be fixed in SWORD?<br>
            <br>
            This bug impacts the search function quite significantly. I
            noticed when my standard test scenario for search started to
            fail after my adjustments.<br>
            The reason was that the search results for my test scenario
            significantly increased and I had to adjust the expected
            results.<br>
            The test scenario searches for "faith" in KJV. Previously
            (before the bugfix) I expected 324 search results.<br>
            After the bugfix/change mentioned below there are now 338
            search results. So you see that quite some verses are missed
            by the search function because of this bug.<br>
            <br>
            Best regards,<br>
            Tobias<br>
          </p>
          <div class="moz-cite-prefix">On 2/23/25 18:38, David Haslam
            wrote:<br>
          </div>
          <blockquote type="cite">
            <div style="font-family: Arial, sans-serif; font-size: 14px;">Excellent
              sleuthing, Tobias !</div>
            <div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
            </div>
            <div class="protonmail_signature_block" style="font-family: Arial, sans-serif; font-size: 14px;">
              <div class="protonmail_signature_block-user"> Best
                regards,<br>
                <br>
                David </div>
              <div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
              </div>
              <div class="protonmail_signature_block-proton"> Sent with
                <a rel="noreferrer nofollow noopener" target="_blank" href="https://proton.me/mail/home">Proton Mail</a> secure email. </div>
            </div>
            <div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
            </div>
            <div class="protonmail_quote"> On Sunday, February 23rd,
              2025 at 5:17 PM, Tobias Klein <a rel="noreferrer nofollow noopener" class="moz-txt-link-rfc2396E" href="mailto:contact@tklein.info"><contact@tklein.info></a>
              wrote:<br>
              <blockquote class="protonmail_quote" type="cite">
                <p>Hi Troy,</p>
                <p>I have discovered the root cause of this bug.</p>
                <p>There is the following code in osisplain.cpp.<br>
                  I suppose the uppercasing action here has negative
                  impact on the overall parsing when the stripText() is
                  running?</p>
                <div style="color: #cccccc;background-color: #1f1f1f;font-family: 'Droid Sans Mono', 'monospace', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span style="color: #cccccc;">    </span><span style="color: #c586c0;">else</span><span style="color: #cccccc;"> </span><span style="color: #c586c0;">if</span><span style="color: #cccccc;"> (</span><span style="color: #d4d4d4;">!</span><span style="color: #dcdcaa;">strncmp</span><span style="color: #cccccc;">(</span><span style="color: #9cdcfe;">token</span><span style="color: #cccccc;">, </span><span style="color: #ce9178;">"/divineName"</span><span style="color: #cccccc;">, </span><span style="color: #b5cea8;">11</span><span style="color: #cccccc;">)) {</span></div><div><span style="color: #6a9955;">      // Get the end portion of the string, and upper case it</span></div><div><span style="color: #cccccc;">      </span><span style="color: #569cd6;">char*</span><span style="color: #cccccc;"> </span><span style="color: #9cdcfe;">end</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">=</span><span style="color: #cccccc;"> </span><span style="color: #9cdcfe;">buf</span><span style="color: #cccccc;">.</span><span style="color: #dcdcaa;">getRawData</span><span style="color: #cccccc;">();</span></div><div><span style="color: #cccccc;">      </span><span style="color: #9cdcfe;">end</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">+=</span><span style="color: #cccccc;"> </span><span style="color: #9cdcfe;">buf</span><span style="color: #cccccc;">.</span><span style="color: #dcdcaa;">size</span><span style="color: #cccccc;">() </span><span style="color: #d4d4d4;">-</span><span style="color: #cccccc;"> </span><span style="color: #9cdcfe;">u</span><span style="color: #cccccc;">-></span><span style="color: #9cdcfe;">lastTextNode</span><span style="color: #cccccc;">.</span><span style="color: #dcdcaa;">size</span><span style="color: #cccccc;">();</span></div><div><span style="color: #cccccc;">      </span><span style="color: #dcdcaa;">toupperstr</span><span style="color: #cccccc;">(</span><span style="color: #9cdcfe;">end</span><span style="color: #cccccc;">);</span></div><div><span style="color: #cccccc;">    }</span></div></div>
                <div class="moz-cite-prefix">When I comment this portion
                  out, the search bug <u>does not occur anymore</u> and
                  I get a correct result, see below.<br>
                  <br>
                  textBuf: For he said, Because the Lord hath sworn that
                  the Lord will have war with Amalek from generation to
                  generation. <br>
                  term: generation to generation<br>
                  Got 11 results!<br>
                  Exod 17:16<br>
                  Isa 13:20<br>
                  Isa 34:10<br>
                  Isa 34:17<br>
                  Isa 51:8<br>
                  Jer 50:39<br>
                  Lam 5:19<br>
                  Dan 4:3<br>
                  Dan 4:34<br>
                  Joel 3:20<br>
                  Luke 1:50</div>
                <div class="moz-cite-prefix"><br>
                </div>
                <div class="moz-cite-prefix">So, what the code stumbles
                  over in the specific case of Exodus 17:16 is the
                  <divineName> tag and the parsing / actions
                  related to it.<br>
                  Why is the uppercasing necessary at all in the code
                  above? Shouldn't this be left to the application
                  software in terms of formatting the respective
                  element/tag in uppercase?<br>
                  <br>
                  Best regards,<br>
                  Tobias<br>
                </div>
                <div class="moz-cite-prefix"><br>
                </div>
                <div class="moz-cite-prefix">On 2/22/25 20:32, Tobias
                  Klein wrote:<br>
                </div>
                <blockquote type="cite">
                  <p>Hi Troy,</p>
                  <p>so I did a little debugging on this.</p>
                  <p>The respective portion of code in swmodule.cpp is
                    this code below. I added some conditional print outs
                    for Exodus 17:16 to see what happens there.</p>
                  <div style="color: #cccccc;background-color: #1f1f1f;font-family: 'Droid Sans Mono', 'monospace', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span style="color: #cccccc;">      </span><span style="color: #c586c0;">case</span><span style="color: #cccccc;"> </span><span style="color: #9cdcfe;">SEARCHTYPE_PHRASE</span><span style="color: #cccccc;">: {</span></div><div><span style="color: #cccccc;">        </span><span style="color: #9cdcfe;">textBuf</span><span style="color: #cccccc;"> </span><span style="color: #dcdcaa;">=</span><span style="color: #cccccc;"> </span><span style="color: #dcdcaa;">stripText</span><span style="color: #cccccc;">();</span></div><div><span style="color: #cccccc;">        </span><span style="color: #c586c0;">if</span><span style="color: #cccccc;"> ((</span><span style="color: #9cdcfe;">flags</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">&</span><span style="color: #cccccc;"> </span><span style="color: #569cd6;">REG_ICASE</span><span style="color: #cccccc;">) </span><span style="color: #d4d4d4;">==</span><span style="color: #cccccc;"> </span><span style="color: #569cd6;">REG_ICASE</span><span style="color: #cccccc;">) </span><span style="color: #9cdcfe;">textBuf</span><span style="color: #cccccc;">.</span><span style="color: #dcdcaa;">toUpper</span><span style="color: #cccccc;">();</span></div>
<div><span style="color: #cccccc;">        </span><span style="color: #4ec9b0;">SWKey</span><span style="color: #569cd6;">*</span><span style="color: #cccccc;"> </span><span style="color: #9cdcfe;">currentKey</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">=</span><span style="color: #cccccc;"> </span><span style="color: #dcdcaa;">getKey</span><span style="color: #cccccc;">();</span></div><div><span style="color: #cccccc;">        </span><span style="color: #4ec9b0;">std</span><span style="color: #cccccc;">::</span><span style="color: #4ec9b0;">string</span><span style="color: #cccccc;"> </span><span style="color: #9cdcfe;">referenceKey</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">=</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;"><a target="_blank" href="http://Exod17:16" class="moz-txt-link-rfc2396E" rel="noreferrer nofollow noopener">"Exod 17:16"</a></span><span style="color: #cccccc;">;</span></div><div><span style="color: #cccccc;">        </span><span style="color: #c586c0;">if</span><span style="color: #cccccc;"> (</span><span style="color: #9cdcfe;">currentKey</span><span style="color: #cccccc;">-></span><span style="color: #dcdcaa;">getShortText</span><span style="color: #cccccc;">() </span><span style="color: #dcdcaa;">==</span><span style="color: #cccccc;"> </span><span style="color: #9cdcfe;">referenceKey</span><span style="color: #cccccc;">) {</span></div><div><span style="color: #cccccc;">          </span><span style="color: #4ec9b0;">std</span><span style="color: #cccccc;">::</span><span style="color: #9cdcfe;">cout</span><span style="color: #cccccc;"> </span><span style="color: #dcdcaa;"><<</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"textBuf: "</span><span style="color: #cccccc;"> </span><span style="color: #dcdcaa;"><<</span><span style="color: #cccccc;"> </span><span style="color: #9cdcfe;">textBuf</span><span style="color: #cccccc;">.</span><span style="color: #dcdcaa;">c_str</span><span style="color: #cccccc;">() </span><span style="color: #dcdcaa;"><<</span><span style="color: #cccccc;"> </span><span style="color: #4ec9b0;">std</span><span style="color: #cccccc;">::</span><span style="color: #dcdcaa;">endl</span><span style="color: #cccccc;">;</span></div><div><span style="color: #cccccc;">          </span><span style="color: #4ec9b0;">std</span><span style="color: #cccccc;">::</span><span style="color: #9cdcfe;">cout</span><span style="color: #cccccc;"> </span><span style="color: #dcdcaa;"><<</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"term: "</span><span style="color: #cccccc;"> </span><span style="color: #dcdcaa;"><<</span><span style="color: #cccccc;"> </span><span style="color: #9cdcfe;">term</span><span style="color: #cccccc;">.</span><span style="color: #dcdcaa;">c_str</span><span style="color: #cccccc;">() </span><span style="color: #dcdcaa;"><<</span><span style="color: #cccccc;"> </span><span style="color: #4ec9b0;">std</span><span style="color: #cccccc;">::</span><span style="color: #dcdcaa;">endl</span><span style="color: #cccccc;">;</span></div><div><span style="color: #cccccc;">        }</span></div></div>
                  <div style="color: #cccccc;background-color: #1f1f1f;font-family: 'Droid Sans Mono', 'monospace', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;">
<div><span style="color: #cccccc;">        // TKL: This is where the actual search per verse happens</span></div><div>  <span style="color: #9cdcfe;">sres</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">=</span><span style="color: #cccccc;"> </span><span style="color: #dcdcaa;">strstr</span><span style="color: #cccccc;">(</span><span style="color: #9cdcfe;">textBuf</span><span style="color: #cccccc;">.</span><span style="color: #dcdcaa;">c_str</span><span style="color: #cccccc;">(), </span><span style="color: #9cdcfe;">term</span><span style="color: #cccccc;">.</span><span style="color: #dcdcaa;">c_str</span><span style="color: #cccccc;">());</span></div></div>
                  <p>I get the following output based on my modification
                    above:<br>
                    <br>
                    textBuf: For he said, Because the <br>
                    term: generation to generation<br>
                  </p>
                  <p>The full verse content of Exodus 17:16 in KJV is
                    this:<br>
                    For he said, Because the Lord hath sworn <i>that</i>
                    the Lord <i>will have</i> war with Amalek from
                    generation to generation. <br>
                    <br>
                    So ... it seems that the stripText() call strips too
                    much of the content (textBuf) of the verse away.<br>
                    Based on that there is no way for the strstr call to
                    succeed detecting the term "generation to
                    generation", because at that point it is not part of
                    the search string (textBuf) anymore.</p>
                  <p>Could you do some investigation regarding the
                    behavior of stripText here?<br>
                    <br>
                    Best regards,<br>
                    Tobias</p>
                  <div class="moz-cite-prefix">On 2/22/25 15:45, Tobias
                    Klein wrote:<br>
                  </div>
                  <blockquote type="cite">Hi Troy, <br>
                    <br>
                    an Ezra Bible App user reported that the phrase
                    search is not working as expected. <br>
                    <br>
                    Here is an example where the results are not as
                    expected. <br>
                    <br>
                    Module: KJV <br>
                    <br>
                    Search term: "generation to generation" <br>
                    <br>
                    I get the following results from the SWORD engine: <br>
                    Isa 13:20 <br>
                    Isa 34:10 <br>
                    Isa 34:17 <br>
                    Isa 51:8 <br>
                    Jer 50:39 <br>
                    Dan 4:3 <br>
                    Dan 4:34 <br>
                    Joel 3:20 <br>
                    Luke 1:50 <br>
                    <br>
                    However, the verse Exodus 17:16 also contains this
                    phrase, but is not in the list of search results. <br>
                    Could it be related to the way how the markup is
                    structured? <br>
                    <br>
                    In Exodus 17:16 [KJV], the markup of the respective
                    phrase looks like this: <br>
                    <br>
                    <w class=<a class="moz-txt-link-rfc2396E">"strong:H01755"</a>>from
                    generation</w> <w class=<a class="moz-txt-link-rfc2396E">"strong:H01755"</a>>to
                    generation</w> <br>
                    <br>
                    This is how I call the search function of the SWORD
                    engine: <br>
                    listKey = module->search(searchTerm.c_str(),
                    int(searchType), flags, scope, 0,
                    internalModuleSearchProgressCB); <br>
                    see <a href="https://github.com/ezra-bible-app/node-sword-interface/blob/master/src/sword_backend/module_search.cpp#L178" class="moz-txt-link-freetext" target="_blank" rel="noreferrer nofollow noopener">https://github.com/ezra-bible-app/node-sword-interface/blob/master/src/sword_backend/module_search.cpp#L178</a><br>
                    <br>
                    Have a nice weekend! <br>
                    <br>
                    Best regards, <br>
                    Tobias <br>
                    <br>
                    _______________________________________________ <br>
                    sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" class="moz-txt-link-abbreviated moz-txt-link-freetext" rel="noreferrer nofollow noopener">sword-devel@crosswire.org</a>
                    <br>
                    <a href="http://crosswire.org/mailman/listinfo/sword-devel" class="moz-txt-link-freetext" target="_blank" rel="noreferrer nofollow noopener">http://crosswire.org/mailman/listinfo/sword-devel</a>
                    <br>
                    Instructions to unsubscribe/change your settings at
                    above page <br>
                  </blockquote>
                  <br>
                  <fieldset class="moz-mime-attachment-header"></fieldset>
                  <pre class="moz-quote-pre" wrap="">_______________________________________________
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" class="moz-txt-link-abbreviated moz-txt-link-freetext" rel="noreferrer nofollow noopener">sword-devel@crosswire.org</a>
<a href="http://crosswire.org/mailman/listinfo/sword-devel" class="moz-txt-link-freetext" target="_blank" rel="noreferrer nofollow noopener">http://crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page
</pre>
                </blockquote>
              </blockquote>
              <br>
            </div>
            <br>
            <fieldset class="moz-mime-attachment-header"></fieldset>
            <pre wrap="" class="moz-quote-pre">_______________________________________________
sword-devel mailing list: <a rel="noreferrer nofollow noopener" class="moz-txt-link-abbreviated moz-txt-link-freetext" href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a>
<a rel="noreferrer nofollow noopener" target="_blank" class="moz-txt-link-freetext" href="http://crosswire.org/mailman/listinfo/sword-devel">http://crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page
</pre>
          </blockquote>
        </blockquote>
        <br>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" class="moz-txt-link-abbreviated" rel="noreferrer nofollow noopener">sword-devel@crosswire.org</a>
<a href="http://crosswire.org/mailman/listinfo/sword-devel" class="moz-txt-link-freetext" target="_blank" rel="noreferrer nofollow noopener">http://crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page
</pre>
    </blockquote>
  


        </blockquote><br>
    </div>