protected function bitapScore($errors, $matchLoc, $patternLen, $searchLoc)
    {
        $accuracy = $errors / $patternLen;
        $proximity = abs($searchLoc - $matchLoc);
        if (!$this->getDistance()) {
            // Dodge divide by zero error.
            return $proximity ? 1.0 : $accuracy;
        }
        return $accuracy + ($proximity/$this->getDistance());
    }