code: function _token_set(str1, str2, options) {
  
          if (!options.tokens) {
              var tokens1 = tokenize(str1);
              var tokens2 = tokenize(str2);
          }
          else {
              var tokens1 = options.tokens[0];
              var tokens2 = options.tokens[1];
          }
  
          var intersection = _intersect(tokens1, tokens2);
          var diff1to2 = _difference(tokens1, tokens2);
          var diff2to1 = _difference(tokens2, tokens1);
  
          var sorted_sect = intersection.sort().join(" ");
          var sorted_1to2 = diff1to2.sort().join(" ");
          var sorted_2to1 = diff2to1.sort().join(" ");
          var combined_1to2 = sorted_sect + " " + sorted_1to2;
          var combined_2to1 = sorted_sect + " " + sorted_2to1;
          
          sorted_sect = sorted_sect.trim();
          combined_1to2 = combined_1to2.trim();
          combined_2to1 = combined_2to1.trim();
          var ratio_func = _ratio;
          //if (options.partial) ratio_func = _partial_ratio;
  
          var pairwise = [
              ratio_func(sorted_sect, combined_1to2, options),
              ratio_func(sorted_sect, combined_2to1, options),
              ratio_func(combined_1to2, combined_2to1, options)
          ]
          if (options.trySimple) {
              pairwise.push(ratio_func(str1, str2, options));
          }
          return Math.max.apply(null, pairwise);
      }
docs: Main Scoring Code