<commit_before>module CoverageCheck
  # String -> (Or Nil String)
  # Given a line of markdown, recognize an ATX header and return the header
  # itself or return nil
  MdHeader = lambda do |line|
    m = line.match(/^#+\s+(.*)$/)
    if m
      m[1].strip
    else
      nil
    end
  end
  # String -> (Or Nil String)
  # Given a line of markdown, recognize a data item header and return it, or
  # return nil
  DataItemHeader = lambda do |line|
    m = line.match(/^\*\*(.*)\*\*$/)
    if m
      m[1].split(/=/)[0].gsub(/\*/,'')
    else
      nil
    end
  end
  # String -> (Map String (Set String))
  # Given the content of a markdown document of a record and its input, return
  # a RecordInputSet for the records and input fields found in that document
  ParseRecordDocument = lambda do |content|
    output = {}
    current_header = nil
    content.lines.map(&:chomp).each do |line|
      h = MdHeader[line]
      if h<commit_msg>Fix issue with picking up whitespace<commit_after>module CoverageCheck
  # String -> (Or Nil String)
  # Given a line of markdown, recognize an ATX header and return the header
  # itself or return nil
  MdHeader = lambda do |line|
    m = line.match(/^#+\s+(.*)$/)
    if m
      m[1].strip
    else
      nil
    end
  end
  # String -> (Or Nil String)
  # Given a line of markdown, recognize a data item header and return it, or
  # return nil
  DataItemHeader = lambda do |line|
    m = line.match(/^\*\*(.*)\*\*$/)
    if m
      m[1].split(/=/)[0].gsub(/\*/,'').strip
    else
      nil
    end
  end
  # String -> (Map String (Set String))
  # Given the content of a markdown document of a record and its input, return
  # a RecordInputSet for the records and input fields found in that document
  ParseRecordDocument = lambda do |content|
    output = {}
    current_header = nil
    content.lines.map(&:chomp).each do |line|
      h = MdHeader[line]
      if h
{'fraction_non_alphanumeric': 0.11995809324253535, 'fraction_numerical': 0.003143006809848088, 'mean_word_length': 2.5045871559633026, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7216060', 'n_tokens_mistral': 612, 'n_tokens_neox': 599, 'n_words': 232}