<commit_before>var test = require('tape');
var nlp = require('../lib/nlp');

var garbage = [
  '',
  '  ',
  null,
  '\n\n', [], {},
];
test('garbage:', function (t) {
  garbage.forEach(function (g, i) {
    var num = nlp(g).list.length;
    var msg = (typeof g) + ' text input #' + i;
    t.equal(num, 0, msg);
  });
  t.end();
});

test('misc:', function (t) {
  var str = '2 million five hundred thousand and fifty nine is bigger than 2882';
  var m = nlp(str).values().toNumber();
  t.equal(m.normal(), '2500059 is bigger than 2882', str);

  str = '2 million five hundred thousand and fifty nine is bigger than 2882';
  m = nlp(str).values().toNiceNumber();
  t.equal(m.plaintext(), '2,500,059 is bigger than 2,882', str);

  str = 'doug is 5 years old';
  m = nlp(str).values().toTextValue();
  t.equal(m.normal(), 'doug is five years old', str);

  // str = 'i\'d buy those nachos';
  // m = nlp(str).sentences().toSingular();
  // t.equal(m.normal(), 'i\'d buy that nacho', str);
  //
  // str = 'i\'d buy these nachos';<commit_msg>tests passing<commit_after>var test = require('tape');
var nlp = require('../lib/nlp');

var garbage = [
  '',
  '  ',
  null,
  '\n\n', [], {},
];
test('garbage:', function (t) {
  garbage.forEach(function (g, i) {
    var num = nlp(g).list.length;
    var msg = (typeof g) + ' text input #' + i;
    t.equal(num, 0, msg);
  });
  t.end();
});

test('misc:', function (t) {
  var str = '2 million five hundred thousand and fifty nine is bigger than 2882';
  var m = nlp(str);
  m.values().toNumber();
  t.equal(m.normal(), '2500059 is bigger than 2882', str);

  str = '2 million five hundred thousand and fifty nine is bigger than 2882';
  m = nlp(str);
  m.values().toNiceNumber();
  t.equal(m.plaintext(), '2,500,059 is bigger than 2,882', str);

  str = 'doug is 5 years old';
  m = nlp(str);
  m.values().toTextValue();
  t.equal(m.normal(), 'doug is five years old', str);

  // str = 'i\'d buy those nachos';
  // m = nlp(str).sentences().toSingular();
  // t.equal(m.normal(), 'i\'d buy that nacho', str);
  //
  // str = 'i\'d buy these nachos';
{'fraction_non_alphanumeric': 0.20859188544152746, 'fraction_numerical': 0.032458233890214794, 'mean_word_length': 3.1669980119284293, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4126209', 'n_tokens_mistral': 840, 'n_tokens_neox': 785, 'n_words': 227}