<commit_before>/*

Experimental...

*/
var net = require('net')
  , mingy = require('../../lib/mingy')
  , Parser = mingy.Parser
  , Command = mingy.Command
  , Shell = mingy.Shell
  , argv = require('optimist').argv

var conn = net.createConnection(8888, '127.0.0.1')
var parser = new Parser()

parser.addCommand('set')
.set('syntax', ['set <key> <value>'])
.set('logic', function(args) {

  conn.write('set ' + args.key + ' ' + args.value)
  return "Attempting set..."
})

// when server has stored value, send command to get value
parser.addCommand('stored')
.set('syntax', ['stored'])
.set('logic', function(args, env) {
  return 'Set succeeded.'
})

conn.on('data', function(data) {

  data = data.toString()

  var output = parser.parse(data)

  if (output) {
    console.log(output)
  }
})

console.log(parser.parseLexemes(argv['_']))
<commit_msg>Removed unneeded dep.<commit_after>/*

Experimental...

*/
var net = require('net')
  , mingy = require('../../lib/mingy')
  , Parser = mingy.Parser
  , Command = mingy.Command
  , argv = require('optimist').argv

var conn = net.createConnection(8888, '127.0.0.1')
var parser = new Parser()

parser.addCommand('set')
.set('syntax', ['set <key> <value>'])
.set('logic', function(args) {

  conn.write('set ' + args.key + ' ' + args.value)
  return "Attempting set..."
})

// when server has stored value, send command to get value
parser.addCommand('stored')
.set('syntax', ['stored'])
.set('logic', function(args, env) {
  return 'Set succeeded.'
})

conn.on('data', function(data) {

  data = data.toString()

  var output = parser.parse(data)

  if (output) {
    console.log(output)
  }
})

console.log(parser.parseLexemes(argv['_']))

{'fraction_non_alphanumeric': 0.19976359338061467, 'fraction_numerical': 0.01182033096926714, 'mean_word_length': 3.8233618233618234, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '740497', 'n_tokens_mistral': 628, 'n_tokens_neox': 589, 'n_words': 132}