<commit_before>
var tuio = {
	cursors: [],
	objects: [],

	_data: { },

	_cb_object_add:    function(data) { },
	_cb_object_update: function(data) { },
	_cb_object_remove: function(data) { },
	_cb_cursor_add:    function(data) { },
	_cb_cursor_update: function(data) { },
	_cb_cursor_remove: function(data) { },

	_connectors: { },

	// Callback from the main event handler

	callback: function(type, sid, fid, x, y, angle) {
		var data;
		
		if ((type != 0) && (type != 3)) {
			data = this._data[sid];
		}
		else {
			data = {
				sid: sid,
				fid: fid
			}
			this._data[sid] = data;
		}

		data.x = x;
		data.y = y;
		
		if (type < 3) {
			data.angle = angle;
		}

		switch (type) {
			case 0: 
				this.objects.push(data);
				this._cb_object_add(data);
				break;

			case 1: 
				this._cb_object_update(data);
				break;

			case 2: 
				this.objects.splice(this.objects.indexOf(data), 1);
				this._cb_object_remove(data);
				break;

			case 3: 
				this.cursors.push(data);
				this._cb_cursor_add(data);
				break;

			case 4: 
				this._cb_cursor_update(data);
				break;

			case 5: 
				this.cursors.splice(this.cursors.indexOf(data), 1);
				this._cb_cursor_remove(data);
				break;

			default:
				break;
		}

		if ((type == 2) || (type == 5)) {
			delete this._data[sid];
		}
	},

	// Callbacks for you, developers!

	object_add:    function(f) { this._cb_object_add    = f; },
	object_update: function(f) { this._cb_object_update = f; },
	object_remove: function(f) { this._cb_object_remove = f; },
	cursor_add:    function(f) { this._cb_cursor_add    = f; },
	cursor_update: function(f) { this._cb_cursor_update = f; },
	cursor_remove: function(f) { this._cb_cursor_remove = f; },

	// Connectors. To be implemented separately.

}

tuio.connector = {

	// Register a new connector

	add: function(name, impl) {
		tuio._connectors[name] = impl;
	},

	// Initialize a connector

	init: function(name) {
		if (name == undefined) {
			for (key in tuio._connectors) {
				name = key;
				break;
			}
		}

		if (name != undefined) {
			tuio._connectors[name].init();
		}
		else {
			// TODO: alert user
		}
	}
}
<commit_msg>Add new method for connector: shutdown<commit_after>
var tuio = {
	cursors: [],
	objects: [],

	_data: { },

	_cb_object_add:    function(data) { },
	_cb_object_update: function(data) { },
	_cb_object_remove: function(data) { },
	_cb_cursor_add:    function(data) { },
	_cb_cursor_update: function(data) { },
	_cb_cursor_remove: function(data) { },

	_connectors: { },

	// Callback from the main event handler

	callback: function(type, sid, fid, x, y, angle) {
		var data;
		
		if ((type != 0) && (type != 3)) {
			data = this._data[sid];
		}
		else {
			data = {
				sid: sid,
				fid: fid
			}
			this._data[sid] = data;
		}

		data.x = x;
		data.y = y;
		
		if (type < 3) {
			data.angle = angle;
		}

		switch (type) {
			case 0: 
				this.objects.push(data);
				this._cb_object_add(data);
				break;

			case 1: 
				this._cb_object_update(data);
				break;

			case 2: 
				this.objects.splice(this.objects.indexOf(data), 1);
				this._cb_object_remove(data);
				break;

			case 3: 
				this.cursors.push(data);
				this._cb_cursor_add(data);
				break;

			case 4: 
				this._cb_cursor_update(data);
				break;

			case 5: 
				this.cursors.splice(this.cursors.indexOf(data), 1);
				this._cb_cursor_remove(data);
				break;

			default:
				break;
		}

		if ((type == 2) || (type == 5)) {
			delete this._data[sid];
		}
	},

	// Callbacks for you, developers!

	object_add:    function(f) { this._cb_object_add    = f; },
	object_update: function(f) { this._cb_object_update = f; },
	object_remove: function(f) { this._cb_object_remove = f; },
	cursor_add:    function(f) { this._cb_cursor_add    = f; },
	cursor_update: function(f) { this._cb_cursor_update = f; },
	cursor_remove: function(f) { this._cb_cursor_remove = f; },

	// Connectors. To be implemented separately.

}

tuio.connector = {

	// Register a new connector

	add: function(name, impl) {
		tuio._connectors[name] = impl;
	},

	// Initialize a connector

	init: function(name) {
		this._call(name, 'init');
	},

	// Shutdown a connector

	shutdown: function(name) {
		this._call(name, 'shutdown');
	},

	_call: function(name, method) {
		if (name == undefined) {
			for (key in tuio._connectors) {
				name = key;
				break;
			}
		}

		if (name != undefined) {
			tuio._connectors[name][method]();
		}
		else {
			// TODO: alert user
		}
	},

}

{'fraction_non_alphanumeric': 0.1536394176931691, 'fraction_numerical': 0.0058230683090705485, 'mean_word_length': 2.846683893195521, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1486444', 'n_tokens_mistral': 2011, 'n_tokens_neox': 1678, 'n_words': 347}