Dates: Added exact-match 'eaѕter' logic
- Without checking for an exact match for 'easter', the date 'easter' is a valid partial match for 'eastermonday'.
This commit is contained in:
@@ -515,9 +515,11 @@ bool closeEnough (
|
||||
const std::string& attempt,
|
||||
unsigned int minLength /* = 0 */)
|
||||
{
|
||||
// An exact match is accepted first.
|
||||
if (compare (reference, attempt, false))
|
||||
return true;
|
||||
|
||||
// A partial match will suffice.
|
||||
if (attempt.length () < reference.length () &&
|
||||
attempt.length () >= minLength)
|
||||
return compare (reference.substr (0, attempt.length ()), attempt, false);
|
||||
|
||||
Reference in New Issue
Block a user