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

require "json"

puts(<<-COMMANDS)
table_create Data TABLE_NO_KEY
column_create Data value COLUMN_SCALAR Text

table_create Terms TABLE_PAT_KEY ShortText \
  --normalizer NormalizerNFKC100 \
  --default_tokenizer TokenRegexp
column_create Terms index COLUMN_INDEX|WITH_POSITION Data value
COMMANDS

puts(<<-LOAD)
load --table Data
[
LOAD
100000.times do
  puts({"value" => "X"}.to_json)
end
puts(<<-LOAD)
]
LAOD<commit_msg>Make the number of records customizable<commit_after>#!/usr/bin/env ruby

require "json"
require "optparse"

n_records = 100000
parser = OptionParser.new
parser.on("--n-records=N", Integer,
          "[#{n_records}]") do |n|
  n_records = n
end
parser.parse!

puts(<<-COMMANDS)
table_create Data TABLE_NO_KEY
column_create Data value COLUMN_SCALAR Text

table_create Terms TABLE_PAT_KEY ShortText \
  --normalizer NormalizerNFKC100 \
  --default_tokenizer TokenRegexp
column_create Terms index COLUMN_INDEX|WITH_POSITION Data value
COMMANDS

puts(<<-LOAD)
load --table Data
[
LOAD
n_records.times do
  puts({"value" => "X"}.to_json)
end
puts(<<-LOAD)
]
LOAD
{'fraction_non_alphanumeric': 0.11121076233183856, 'fraction_numerical': 0.016143497757847534, 'mean_word_length': 5.098360655737705, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 5, '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': '1873650', 'n_tokens_mistral': 420, 'n_tokens_neox': 405, 'n_words': 99}