<commit_before>#!/usr/bin/env ruby

require 'colorize'

print "input category: "
input_category_name = gets.chomp.downcase
print "input topic name: "
input_topic_name = gets.chomp.downcase

file_title = input_topic_name.split.map { |word| word.capitalize }.join(" ")
file_name = input_topic_name.gsub(/\s+/m,"-") + ".md"
puts "new file: " + file_name.green + " with title: " + file_title.blue

file_path = input_category_name + "/" + file_name

File.open(file_path, "w") do |md_file|
  md_file.write("# #{file_title}\n\n# Reference\n")
end
puts "write template post into path: " + file_path.bold<commit_msg>add empty category name or title name check<commit_after>#!/usr/bin/env ruby

require 'colorize'

print "input category: "
input_category_name = gets.chomp.downcase
print "input topic name: "
input_topic_name = gets.chomp.downcase

if input_category_name.empty? || input_topic_name.empty?
  puts "Error: category name and topic name can't be blank...".red
  exit 1
end

file_title = input_topic_name.split.map { |word| word.capitalize }.join(" ")
file_name = input_topic_name.gsub(/\s+/m,"-") + ".md"
puts "new file: " + file_name.green + " with title: " + file_title.blue

file_path = input_category_name + "/" + file_name

File.open(file_path, "w") do |md_file|
  md_file.write("# #{file_title}\n\n# Reference\n")
end
puts "write template post into path: " + file_path.bold
{'fraction_non_alphanumeric': 0.14616497829232997, 'fraction_numerical': 0.000723589001447178, 'mean_word_length': 4.810924369747899, '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': '4071128', 'n_tokens_mistral': 508, 'n_tokens_neox': 498, 'n_words': 118}