<commit_before>var term_to_binary = require('./term_to_binary');

//require('sys').puts(exports.term_to_binary(5));
var t = ["jason", 'hunter', 'smith'];
t = [1, 2, 3];

console.log("Sending: " + require('sys').inspect(t));
var b = term_to_binary.term_to_binary(t);
var fs = require('fs');
fs.open('/tmp/out', 'w', 066, function(er, fd) {
  if(er) throw er;
  fs.write(fd, b, 0, b.length, null, function(er, bytes) {
    if(er) throw er;
    if(bytes != b.length)
      throw new Error("Tried to write " + b.length + " but only wrote " + bytes);
    console.log('Written');
  })
})<commit_msg>A somewhat useful test<commit_after>var term_to_binary = require('./term_to_binary');

//require('sys').puts(exports.term_to_binary(5));
var t = [                          // array
        , ['two', 'array']         // Innocent 2-array
        , "ABCDE"                  // string (char list, encoded as STRING)
        , [/a/, 'foo']             // atom
        , [/a/, 'GET']
        , [/b/, 'ภาษาไทย']         // binary
        , [[[[23, 'skidoo']]]]     // nested objects
        , [/t/, [ 'tuple'          // tuple
                , 'here'
                , [/a/, 'too']
                ]
          ]
        ];

console.log("Sending: " + require('sys').inspect(t));
var b = term_to_binary.term_to_binary(t);
var fs = require('fs');
fs.open('/tmp/out', 'w', 0644, function(er, fd) {
  if(er) throw er;
  fs.write(fd, b, 0, b.length, null, function(er, bytes) {
    if(er) throw er;
    if(bytes != b.length)
      throw new Error("Tried to write " + b.length + " but only wrote " + bytes);
    console.log('Written');
  })
})
{'fraction_non_alphanumeric': 0.2008626001232286, 'fraction_numerical': 0.010474430067775724, 'mean_word_length': 2.241516966067864, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '428106', 'n_tokens_mistral': 593, 'n_tokens_neox': 574, 'n_words': 130}