code: function replacePatterns(token, replacements, measureThreshold) {
      var result = attemptReplacePatterns(token, replacements, measureThreshold);
      token = result == null ? token : result;
      
      return token;
  }
docs: replace a list of patterns/replacements on a word. if no match is made return the original token.