<commit_before>//load statechart from scxml string; return initial state and token id

//send event to statechart with tokenid
//clean up statechart

var xml2jsonml = require('xml2jsonml'),
    scion = require('../lib/scion'),
    http = require('http');

var sessionCounter = 0, sessions = {}, timeouts = {}, timeoutMs = 5000;

function loadScxml(scxmlStr,cb){
    xml2jsonml.parseString(scxmlStr,function(err,scxmlJson){
        if(err){
            throw err;
        }

        //console.log(JSON.stringify(scxmlJson,4,4));

        var annotatedScxmlJson = scion.annotator.transform(scxmlJson,true,true,true,true);
        var model = scion.json2model(annotatedScxmlJson); 
        var interpreter = new scion.scxml.NodeInterpreter(model);
        interpreter.start();

        var sessionToken = sessionCounter;
        sessionCounter++;
        sessions[sessionToken] = interpreter; 

        cb(sessionToken,interpreter);
    });
}

function cleanUp(sessionToken){
    delete sessions[sessionToken];
}

http.createServer(function (req, res) {<commit_msg>Updated relative path to require in test server.<commit_after>//load statechart from scxml string; return initial state and token id

//send event to statechart with tokenid
//clean up statechart

var xml2jsonml = require('xml2jsonml'),
    scion = require('../lib/core/scion'),
    http = require('http');

var sessionCounter = 0, sessions = {}, timeouts = {}, timeoutMs = 5000;

function loadScxml(scxmlStr,cb){
    xml2jsonml.parseString(scxmlStr,function(err,scxmlJson){
        if(err){
            throw err;
        }

        //console.log(JSON.stringify(scxmlJson,4,4));

        var annotatedScxmlJson = scion.annotator.transform(scxmlJson,true,true,true,true);
        var model = scion.json2model(annotatedScxmlJson); 
        var interpreter = new scion.scxml.NodeInterpreter(model);
        interpreter.start();

        var sessionToken = sessionCounter;
        sessionCounter++;
        sessions[sessionToken] = interpreter; 

        cb(sessionToken,interpreter);
    });
}

function cleanUp(sessionToken){
    delete sessions[sessionToken];
}

http.createServer(function (req, res) {
{'fraction_non_alphanumeric': 0.11737523105360444, 'fraction_numerical': 0.010166358595194085, 'mean_word_length': 3.454732510288066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 26}, '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': '4697436', 'n_tokens_mistral': 654, 'n_tokens_neox': 631, 'n_words': 139}