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.
In node-sword-interface I added some logic for this, so that the user does not have to consider that.
// If the Strong's key is OT we need to insert a zero
in front of the key
// This is necessary because the Sword modules with
Strong's have a zero in front of the Hebrew Strong's numbers
if (searchTerm[0] == 'H' &&
this->_textProcessor.moduleHasStrongsZeroPrefixes(module)) {
// Cut out the number from the Strong's key
(starting at index 1 until end of string)
string strongsKey = searchTerm.substr(1,
searchTerm.size());
// Overwrite the searchTerm with an inserted 0
searchTerm = "H0" + strongsKey;
}
Best regards,
Tobias
_______________________________________________ sword-devel mailing list: sword-devel@crosswire.org http://crosswire.org/mailman/listinfo/sword-devel Instructions to unsubscribe/change your settings at above page