<commit_before>String::capitalize = ->
  @replace /(^|\s)([a-z])/g, (m, p1, p2) ->
    p1 + p2.toUpperCase()

generateText = (source) -> "#{source.comment || 'Untitled'} (#{generateType(source)})"

# TODO: expand this list
generateType = (source) ->
  if "switch" of source then "switch"<commit_msg>improved board display<commit_after>String::capitalize = ->
  @replace /(^|\s)([a-z])/g, (m, p1, p2) ->
    p1 + p2.toUpperCase()

generateName = (source) -> source.comment || 'Untitled'

generateText = (source) -> 
  switch generateType(source)
    when "switch" then "#{generateName(source)} (#{source.switch})"
    when "processor" then "#{generateName(source)} (#{source.processor})"
    when "emitter" then "#{generateName(source)} (Emitter)"
    when "splitter" then "#{generateName(source)} (Splitter)"
    else throw new Error("Unknown type of chip #{source}")

# TODO: expand this list
generateType = (source) ->
  if "switch" of source then "switch"
{'fraction_non_alphanumeric': 0.19206680584551147, 'fraction_numerical': 0.008350730688935281, 'mean_word_length': 4.608187134502924, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '3857490', 'n_tokens_mistral': 329, 'n_tokens_neox': 324, 'n_words': 82}