lib/dmp.js
function match_bitapScore_(e, x) {
    var accuracy = e / pattern.length;
    var proximity = Math.abs(loc - x);
    if (!self.Match_Distance) {
      // Dodge divide by zero error.
      return proximity ? 1.0 : accuracy;
    }
    return accuracy + (proximity / self.Match_Distance);
  }
function match_bitapScore_(e, x) {
    var accuracy = e / pattern.length;
    var proximity = Math.abs(loc - x);
    if (!self.Match_Distance) {
      // Dodge divide by zero error.
      return proximity ? 1.0 : accuracy;
    }
    return accuracy + (proximity / self.Match_Distance);
  }
function match_bitapScore_ ( e , x ) { var accuracy = e / pattern . length ; var proximity = Math . abs ( loc - x ) ; if ( ! self . Match_Distance ) { // Dodge divide by zero error. return proximity ? 1.0 : accuracy ; } return accuracy + ( proximity / self . Match_Distance ) ; }
'this' becomes 'window' in a closure. 
Compute and return the score for a match with e errors and x location.
Accesses loc and pattern through being a closure.
@param {number} e Number of errors in match.
@param {number} x Location of match.
@return {number} Overall score for match (0.0 = good, 1.0 = bad).
@private
this becomes window in a closure . Compute and return the score for a match with e errors and x location . Accesses loc and pattern through being a closure .