<commit_before>use NumSuch,
    Postgres,
    Time;

// PERFORMANCE BENCHMARKS FOR MATRIX DB INTERACTIONS

// RESULTS ARE AT THE BOTTOM OF THE FILE IN A MULTILINE COMMENT




config const DB_HOST: string = "192.168.3.11";
config const DB_USER: string = "buddha";
config const DB_NAME: string = "loch_brian";
config const DB_PWD: string = "<PASSWORD>!!";
var con = PgConnectionFactory(host=DB_HOST, user=DB_USER, database=DB_NAME, passwd=DB_PWD);

var nameTable = "r.cui_confabulation",
    idField = "ftr_id",
    nameField = "source_str",
    edgeTable1 = "r.cui_confabulation",
    fromField1 = "source_cui",
    toField1 = "exhibited_cui",
    wField1 = "NONE",
    wTable = "cc_weight",
    n = 8;

//var X = NamedMatrixFromPG();
var t: Timer;
t.start();
var X = NamedMatrixFromPG(con, edgeTable = edgeTable1, fromField = fromField1, toField = toField1); //X.fromPG(con, edgeTable = edgeTable1, fromField = fromField1, toField = toField1);
t.stop();
writeln("Time to load NamedMatrix of CUIs: %n".format(t.elapsed()));
//writeln(X.domain);
<commit_msg>error message added to cui-test<commit_after>use NumSuch,
    Postgres,
    Time;

// PERFORMANCE BENCHMARKS FOR MATRIX DB INTERACTIONS

// RESULTS ARE AT THE BOTTOM OF THE FILE IN A MULTILINE COMMENT




config const DB_HOST: string = "";
config const DB_USER: string = "";
config const DB_NAME: string = "";
config const DB_PWD: string = "";

if DB_HOST == "" { var msg =
  """
Cannot find the file 'db_creds.txt'. Please create it in the current directory with the fields

DB_HOST=
DB_USER=
DB_NAME=
DB_PWD=

And DO NOT check it into GitHub. (In fact, Git will try to ignore it.)
  """;
  writeln(msg);
  halt();
}


var con = PgConnectionFactory(host=DB_HOST, user=DB_USER, database=DB_NAME, passwd=DB_PWD);

var nameTable = "r.cui_confabulation",
    idField = "ftr_id",
    nameField = "source_str",
    edgeTable1 = "r.cui_confabulation",
    fromField1 = "source_cui",
    toField1 = "exhibited_cui",
    wField1 = "NONE",
    wTable = "cc_weight",
    n = 8;




//var X = NamedMatrixFromPG();
var t: Timer;
t.start();
var X = NamedMatrixFromPG(con, edgeTable = edgeTable1, fromField = fromField1, toField = toField1); //X.fromPG(con, edgeTable = edgeTable1, fromField = fromField1, toField = toField1);
t.stop();
writeln("Time to load NamedMatrix of CUIs: %n".format(t.elapsed()));
//writeln(X.domain);

{'fraction_non_alphanumeric': 0.13043478260869565, 'fraction_numerical': 0.013085690164626424, 'mean_word_length': 4.220264317180617, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '3349204', 'n_tokens_mistral': 891, 'n_tokens_neox': 865, 'n_words': 239}