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

#use "topfind";;
#require "lwt.unix";;
#require "irc-client.lwt";;
#require "str";;
#require "yojson";;
#require "containers";;
#directory "_build/src";;
#load "coucoulib.cma";;

let s = CCIO.with_in "old_dump" CCIO.read_lines_l;;
let l = CCList.filter_map Factoids.parse_op s;;
Prelude.StrMap.cardinal fs;;
let fs = List.fold_left (fun acc (Factoids.Set f) -> Factoids.append f acc) Factoids.empty l;;
Prelude.StrMap.cardinal fs;;
Factoids.write_file ~file:"factoids.json" fs;;
<commit_msg>fix import script<commit_after>#!/usr/bin/env ocaml

#use "topfind";;
#require "lwt.unix";;
#require "irc-client.lwt";;
#require "str";;
#require "yojson";;
#require "containers";;
#directory "_build/src";;
#load "coucoulib.cma";;

let s = CCIO.with_in "old_dump" CCIO.read_lines_l;;
let l = CCList.filter_map Factoids.parse_op s;;
let fs = List.fold_left (fun acc (Factoids.Set f) -> Factoids.append f acc) Factoids.empty l;;
Printf.printf "%d records\n" (Prelude.StrMap.cardinal fs);;
Factoids.write_file ~file:"factoids.json" fs |> Lwt_main.run;;

{'fraction_non_alphanumeric': 0.17996289424860853, 'fraction_numerical': 0.0, 'mean_word_length': 5.786163522012578, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '5067545', 'n_tokens_mistral': 446, 'n_tokens_neox': 436, 'n_words': 98}