<commit_before>
/**
 * Module dependencies.
 */

var express = require('express');
var routes = require('./routes');
var user = require('./routes/user');
var http = require('http');
var path = require('path');

var app = express();

// Models
var LSystem = require('./models/lsystem');
var RuleParser = require('./models/rule_parser');

// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));

// development only
if ('development' == app.get('env')) {
  app.use(express.errorHandler());
}

app.get('/', routes.index);
app.get('/users', user.list);

app.post('/new_lsystem', function(req, res) {
  var rp = new RuleParser(req.body.rules);
  var alphabet = req.body.alphabet.split(', ');
  var angle = parseFloat(req.body.angle);
  var rules = rp.parse();

  var ls = new LSystem(alphabet, req.body.axiom, rules, req.body.draw_chars);
  ls.set_angle(angle);
  ls.generate(req.body.iterations);
  console.log('[DEBUG] ls = ' + JSON.stringify(ls));

  res.render('lsys', {lsys: ls, title: 'L-System Drawing'});
});

http.createServer(app).listen(app.get('port'), function(){
  console.log('Express server listening on port ' + app.get('port'));
});<commit_msg>Split draw_chars string into a proper array<commit_after>
/**
 * Module dependencies.
 */

var express = require('express');
var routes = require('./routes');
var user = require('./routes/user');
var http = require('http');
var path = require('path');

var app = express();

// Models
var LSystem = require('./models/lsystem');
var RuleParser = require('./models/rule_parser');

// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));

// development only
if ('development' == app.get('env')) {
  app.use(express.errorHandler());
}

app.get('/', routes.index);
app.get('/users', user.list);

app.post('/new_lsystem', function(req, res) {
  var rp = new RuleParser(req.body.rules);
  var alphabet = req.body.alphabet.split(', ');
  var angle = parseFloat(req.body.angle);
  var rules = rp.parse();
  var draw_chars = req.body.draw_chars.split(', ');

  var ls = new LSystem(alphabet, req.body.axiom, rules, draw_chars);
  ls.set_angle(angle);
  ls.generate(req.body.iterations);
  console.log('[DEBUG] ls = ' + JSON.stringify(ls));

  res.render('lsys', {lsys: ls, title: 'L-System Drawing'});
});

http.createServer(app).listen(app.get('port'), function(){
  console.log('Express server listening on port ' + app.get('port'));
});
{'fraction_non_alphanumeric': 0.21131053166271588, 'fraction_numerical': 0.0027091093802912294, 'mean_word_length': 4.991886409736308, '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': '1918294', 'n_tokens_mistral': 1007, 'n_tokens_neox': 980, 'n_words': 205}