<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <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 class="moz-txt-link-rfc2396E" href="Exod17:16">"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></p>
    <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"
      cite="mid:04f89b33-f317-4ea4-b905-2899bf4bb167@tklein.info">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" href="strong:H01755">"strong:H01755"</a>>from generation</w> <w
      class=<a class="moz-txt-link-rfc2396E" href="strong:H01755">"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 class="moz-txt-link-freetext" href="https://github.com/ezra-bible-app/node-sword-interface/blob/master/src/sword_backend/module_search.cpp#L178">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 class="moz-txt-link-abbreviated" href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a>
      <br>
      <a class="moz-txt-link-freetext" href="http://crosswire.org/mailman/listinfo/sword-devel">http://crosswire.org/mailman/listinfo/sword-devel</a>
      <br>
      Instructions to unsubscribe/change your settings at above page
      <br>
    </blockquote>
  </body>
</html>