<commit_before>class LGTM
  @refreshRate = 5 * 60 * 1000
  @positiveKeywordsRegexes = []
  @negativeKeywordsRegexes = []

  @defaultOptions:
    "positive-keywords": ":+1:\nlgtm\n:thumbsup:"
    "negative-keywords": ":-1:\n:thumbsdown:"
    "disable-merge": false
    "disable-merge-threshold": 2
    "disable-wip": false
    "disable-wip-keywords": "wip\ndo not merge"

  initialize: () ->
    refresh()

  regexify: (string) ->
    $.map string.split(/\n/), (sub) ->
      RegExp(sub.replace(/[\-\/\\\^\$\*\+\?\.\(\)\|\[\]\{\}]/g, "\\$&"), "gi")

  formatCount: (count) ->
    if count > 0 then "+#{count}" else "#{count}"

  countVotes: (page) ->
    votes  = {}
    $(".timeline-comment-wrapper", page).each (_, comment) =>
      comment_text   = $(comment).find(".comment-body p").html()
      comment_author = $(comment).find(".timeline-comment-header-text .author").text()
      return unless comment_text || comment_text == ""

      positive = false
      negative = false

      for regex in @positiveKeywordsRegexes
        positive = true if comment_text.match(regex)
      for regex in @negativeKeywordsRegexes
        negative = true if comment_text.match(regex)

      if positive || negative<commit_msg>Fix empty lines in regex keywords<commit_after>class LGTM
  @refreshRate = 5 * 60 * 1000
  @positiveKeywordsRegexes = []
  @negativeKeywordsRegexes = []

  @defaultOptions:
    "positive-keywords": ":+1:\nlgtm\n:thumbsup:"
    "negative-keywords": ":-1:\n:thumbsdown:"
    "disable-merge": false
    "disable-merge-threshold": 2
    "disable-wip": false
    "disable-wip-keywords": "wip\ndo not merge"

  initialize: () ->
    refresh()

  regexify: (string) ->
    $.map string.split(/\n/), (sub) ->
      return null if sub.length == 0 || !sub.trim()
      RegExp(sub.replace(/[\-\/\\\^\$\*\+\?\.\(\)\|\[\]\{\}]/g, "\\$&"), "gi")

  formatCount: (count) ->
    if count > 0 then "+#{count}" else "#{count}"

  countVotes: (page) ->
    votes  = {}
    $(".timeline-comment-wrapper", page).each (_, comment) =>
      comment_text   = $(comment).find(".comment-body p").html()
      comment_author = $(comment).find(".timeline-comment-header-text .author").text()
      return unless comment_text || comment_text == ""

      positive = false
      negative = false

      for regex in @positiveKeywordsRegexes
        positive = true if comment_text.match(regex)
      for regex in @negativeKeywordsRegexes
        negative = true if comment_text.match(regex)

      if positive || negative
{'fraction_non_alphanumeric': 0.18685258964143425, 'fraction_numerical': 0.009163346613545816, 'mean_word_length': 2.8630769230769233, 'pattern_counts': {'":': 16, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4581017', 'n_tokens_mistral': 847, 'n_tokens_neox': 799, 'n_words': 170}