<commit_before>/*!
* sphinxapi
* Copyright(c) 2012 <NAME> <<EMAIL>>
* MIT Licensed
*/

/**
* Module dependencies.
*/
var net   = require('net'),
	bp    = require('bufferpack'),
	Put   = require('put'),
	assert = require('assert'),
	util = require('util'),
	debug = require('debug')('SphinxClient'),
	server_say = require('debug')('server'),
	client_say = require('debug')('client')
;

/**
* Useful function
*
* @api private
*/

function ConcatBuffer(a, b) {
	var t = new Buffer(a.length + b.length)
	a.copy(t, 0, 0)
	b.copy(t, a.length, 0)
	return t
}
function ReduceBuffer(a, b) { 
	if (typeof b != 'object') {
		b = new Buffer(b)
	}
	return ConcatBuffer(a, b); 
}

function forEach(o, fn) {
	if (Array.isArray(o)) {
		return o.forEach(fn);
	}
	else {
		for (var key in o) {
			if (o.hasOwnProperty(key)) {
				fn(key, o[key])
			}
		}
	}
}
function len (o){    
	if (Array.isArray(o) || typeof o == 'string') {
		return o.length;
	}
	else {
		var k, l = 0;
		for(k in o) {
			l += Number( obj.hasOwnProperty(k) );
		}
		return l;
	}
}
function unpack(a, b) {
	return bp.unpack(a, b);
}
function pack(a, b) {
	return bp.pack(a, b);
}

/**
* SphinxClient Object
*
* @api public
*/
function SphinxClient() { <commit_msg>right lengt for utf8 string<commit_after>/*!
* sphinxapi
* Copyright(c) 2012 <NAME> <<EMAIL>>
* MIT Licensed
*/

/**
* Module dependencies.
*/
var net   = require('net'),
	bp    = require('bufferpack'),
	Put   = require('put'),
	assert = require('assert'),
	util = require('util'),
	debug = require('debug')('SphinxClient'),
	server_say = require('debug')('server'),
	client_say = require('debug')('client')
;

/**
* Useful function
*
* @api private
*/

function ConcatBuffer(a, b) {
	var t = new Buffer(a.length + b.length)
	a.copy(t, 0, 0)
	b.copy(t, a.length, 0)
	return t
}
function ReduceBuffer(a, b) { 
	if (typeof b != 'object') {
		b = new Buffer(b)
	}
	return ConcatBuffer(a, b); 
}

function forEach(o, fn) {
	if (Array.isArray(o)) {
		return o.forEach(fn);
	}
	else {
		for (var key in o) {
			if (o.hasOwnProperty(key)) {
				fn(key, o[key])
			}
		}
	}
}
function len (o){    
	if (Array.isArray(o)) {
		return o.length;
	}
	else if (typeof o == 'string') {
		return Buffer.byteLength(o)
	}
	else {
		var k, l = 0;
		for(k in o) {
			l += Number( obj.hasOwnProperty(k) );
		}
		return l;
	}
}
function unpack(a, b) {
	return bp.unpack(a, b);
}
function pack(a, b) {
	return bp.pack(a, b);
}

/**
* SphinxClient Object
*
* @api public
*/
function SphinxClient() { 
{'fraction_non_alphanumeric': 0.19438877755511022, 'fraction_numerical': 0.006813627254509018, 'mean_word_length': 3.4021164021164023, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4178606', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1017, 'n_words': 244}