<commit_before>-module(tachyon_console).

-export([load_rules/1, test_rules/1]).

-ignore_xref([test_rules/1]).

test_rules(File) ->
    load_rules(tachyon_kstat_test, File).

load_rules(File) ->
    load_rules(tachyon_kstat, File).

load_rules(Module, File) ->
    ModuleS = atom_to_list(Module),
    ErlFile = "/tmp/" ++ ModuleS ++ ".erl",
    BeamFile = ModuleS ++ ".beam",
    Opts = [verbose, report_errors, report_warnings, binary],
    p("Compilation started."),
    p("Rule File:           ~s", [File]),
    p("Output File:         ~s", [ErlFile]),
    p("Target Module:       ~s", [Module]),
    p("BEAM Filename:       ~s", [ErlFile]),
    p("Compilation Options: ~s", [Opts]),
    case tachyon_c:c(Module, File) of
        {ok, ErlCode} ->
            p("Compilation succesful."),
            case file:write_file(ErlFile, ErlCode) of
                ok ->
                    p("Output written."),<commit_msg>Fixed formating.<commit_after>-module(tachyon_console).

-export([load_rules/1, test_rules/1]).

-ignore_xref([test_rules/1]).

test_rules(File) ->
    load_rules(tachyon_kstat_test, File).

load_rules(File) ->
    load_rules(tachyon_kstat, File).

load_rules(Module, File) ->
    ModuleS = atom_to_list(Module),
    ErlFile = "/tmp/" ++ ModuleS ++ ".erl",
    BeamFile = ModuleS ++ ".beam",
    Opts = [verbose, report_errors, report_warnings, binary],
    p("Compilation started."),
    p("Rule File:           ~s", [File]),
    p("Output File:         ~s", [ErlFile]),
    p("Target Module:       ~s", [Module]),
    p("BEAM Filename:       ~s", [ErlFile]),
    p("Compilation Options: ~p", [Opts]),
    case tachyon_c:c(Module, File) of
        {ok, ErlCode} ->
            p("Compilation succesful."),
            case file:write_file(ErlFile, ErlCode) of
                ok ->
                    p("Output written."),
{'fraction_non_alphanumeric': 0.17181571815718158, 'fraction_numerical': 0.0032520325203252032, 'mean_word_length': 2.641025641025641, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '7540346', 'n_tokens_mistral': 661, 'n_tokens_neox': 644, 'n_words': 126}