<div dir="ltr"><div>can you do a regular-expression search? which would be:</div><div><br></div><div>G11[^0123456789]</div><div><br></div><div>i.e., G followed by 1, followed by 1, followed by not-a-digit.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jun 16, 2024 at 3:27 AM Tobias Klein <<a href="mailto:contact@tklein.info">contact@tklein.info</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p><br>
</p>
<div>On 5/14/24 5:20 PM, David "Judah's
Shadow" Blue wrote:<br>
</div>
<blockquote type="cite"><br>
<pre>I'm sure I could add some logic to check the given module and adapt the token
to fit, but that doesn't help the other issue I've found. When searching for,
say, G11 in a module that isn't 0 padded, all occurrences of G11 are found,
but so are all occurrences of G110, G1105, etc. Assuming that normalization of
padding on the entity attributes adds padding to them so it's in the form of
G0XXXX, that should cut down on the false matches significantly.</pre>
</blockquote>
<p>In node-sword-interface I added some logic for this, so that the
user does not have to consider that.</p>
<p><a href="https://github.com/ezra-bible-app/node-sword-interface/blob/794c349bece231e2aa58bdacb7fe4aaffe774bcf/src/sword_backend/module_search.cpp#L146" target="_blank">https://github.com/ezra-bible-app/node-sword-interface/blob/794c349bece231e2aa58bdacb7fe4aaffe774bcf/src/sword_backend/module_search.cpp#L146</a></p>
<p> // If the Strong's key is OT we need to insert a zero
in front of the key<br>
// This is necessary because the Sword modules with
Strong's have a zero in front of the Hebrew Strong's numbers<br>
if (searchTerm[0] == 'H' &&
this->_textProcessor.moduleHasStrongsZeroPrefixes(module)) {<br>
// Cut out the number from the Strong's key
(starting at index 1 until end of string)<br>
string strongsKey = searchTerm.substr(1,
searchTerm.size());<br>
// Overwrite the searchTerm with an inserted 0<br>
searchTerm = "H0" + strongsKey;<br>
}</p>
<p>Best regards,<br>
Tobias<br>
</p>
<p><br>
</p>
<br>
</div>
_______________________________________________<br>
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a><br>
<a href="http://crosswire.org/mailman/listinfo/sword-devel" rel="noreferrer" target="_blank">http://crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br>
</blockquote></div>