Dice so nerdy, they make other dice seem not nerdy

written last night prior to seeing this post:


// some false positives like "Nor," "'Hee-haw!'" (including the quotes, from theoriginal)
var enforceEndingPunct = function(lines) {
  let re = /[.?!]$|^$/,
      finalPunct = config.finalPunct || `.`;
  // TODO: elaboration, if not defined, see what's most common? or some other heuristic
  lines = lines.map((l) => re.test(l) ? l : l + finalPunct);
  return lines;
};
1 Like