<commit_before>
module DraftModeFormatting

  # Replace special markup with appropriate output - e.g. highlight FIXME
  def DraftModeFormatting::markup paragraph, creator
    if not $style[:final]
      # highlight first sentence
      paragraph.replace_once('^(([\w\']+\s[^\.]+\.))', proc { | buf, orig | creator.highlight(buf) } )
      # Mark large numbers
      paragraph.replace_once('(((\d\d\d\d)\s))', proc { | buf, orig | creator.correct(buf) } )
      # don't use a comma before because
      paragraph.replace_once('((,\s+(because|while|partly)))', proc { | buf, orig | creator.correct(buf) } )
      # use a comma after i.e. and e.g.
      paragraph.replace_once('((\s+(i\.e\.|e\.g\.)\s))', proc { | buf, orig | creator.correct(buf) } )
      # use punctuation inside quotes
      paragraph.replace_once('((([\'"].)\s))', proc { | buf, orig | creator.correct(buf) } )
      # follow by a comma
      paragraph.replace_once('(((In addition|Likewise|Sometimes|Here|For data)\s))', proc { | buf, orig | creator.correct(buf) } )
      # should have dash
      paragraph.replace_once('((\s(cross (language|platform)|(high|low) performance|\w+ level|\w+ sized)))', proc { | buf, orig | creator.correct(buf) } )
      # should have no dash
      paragraph.replace_once('((\s(open-source)))', proc { | buf, orig | creator.correct(buf) } )

      # use a comma before 'and'
      # paragraph.replace_once('(([^\,]\s+and))', proc { | buf, orig | creator.markword(buf) } )
    end
    paragraph
  end
end

<commit_msg>formatting<commit_after>
module DraftModeFormatting

  # Replace special markup with appropriate output - e.g. highlight FIXME
  def DraftModeFormatting::markup paragraph, creator
    if not $style[:final]
      # highlight first sentence
      paragraph.replace_once('^(([\w\']+\s[^\.]+\.))', proc { | buf, orig | creator.highlight(buf) } )
      # Mark large numbers
      paragraph.replace_once('(((\d\d\d\d)\s))', proc { | buf, orig | creator.correct(buf) } )
      # don't use a comma before because
      paragraph.replace_once('((,\s+(without|because|while|partly)))', proc { | buf, orig | creator.correct(buf) } )
      # use a comma after i.e. and e.g.
      paragraph.replace_once('((\s+(i\.e\.|e\.g\.)\s))', proc { | buf, orig | creator.correct(buf) } )
      # use punctuation inside quotes
      paragraph.replace_once('((([\'"].)\s))', proc { | buf, orig | creator.correct(buf) } )
      # follow by a comma
      paragraph.replace_once('(((In addition|Likewise|Sometimes|Here|So far|For \w+)\s))', proc { | buf, orig | creator.correct(buf) } )
      # should have dash
      paragraph.replace_once('((\s(cross (language|platform)|(high|low) performance|\w+ level|\w+ sized|based)))', proc { | buf, orig | creator.correct(buf) } )
      # should have no dash
      paragraph.replace_once('((\s(open-source|web-service)))', proc { | buf, orig | creator.correct(buf) } )

      # use a comma before 'and'
      # paragraph.replace_once('(([^\,]\s+and))', proc { | buf, orig | creator.markword(buf) } )
    end
    paragraph
  end
end


{'fraction_non_alphanumeric': 0.18499184339314845, 'fraction_numerical': 0.0, 'mean_word_length': 3.2583333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2259352', 'n_tokens_mistral': 1005, 'n_tokens_neox': 969, 'n_words': 227}