stringmetric icon indicating copy to clipboard operation
stringmetric copied to clipboard

`com.rockymadden.stringmetric.transform` character ranges are exclusive

Open zoltanmaric opened this issue 10 years ago • 0 comments

The character ranges in com.rockymadden.stringmetric.transform

    private val Ascii = NumericRange(0x00, 0x7F, 1)
    private val ExtendedAscii = NumericRange(0x00, 0x7F, 1)
    private val Latin = NumericRange(0x00, 0x24F, 1)
    private val LowerCase = NumericRange(0x61, 0x7A, 1)
    private val Numbers = NumericRange(0x30, 0x39, 1)
    private val UpperCase = NumericRange(0x41, 0x5A, 1)

do not include all the intended characters, because the apply method of Scala's NumericRange is exclusive, i.e. it does not include the upper bound of the defined range. Consequently, LowerCase does not include z, UpperCase does not include Z, Numbers does not include 9, etc. Thus, when using withTransform with any of the predefined filters in this object, these characters will be discarded from comparison.

zoltanmaric avatar Nov 17 '15 21:11 zoltanmaric