<commit_before>'use strict';

koara.StringReader = function(text) {
	this.index = 0;
	this.text = text;
}

koara.StringReader.prototype = {
	constructor: koara.StringReader,
	
	read: function(buffer, offset, length) {
		if(this.text.substr(this.index).length > 0) {
			var charactersRead = 0;
			for(var i=0; i < length; i++) {
				var c = this.text.substr(this.index + i, 1);
				if(c !== '') {
					buffer[offset + i] = c;
					charactersRead++;
				}
			}
			this.index += length;
			return charactersRead;
		}
		return -1;
	}
}<commit_msg>fix stringreader<commit_after>'use strict';

koara.StringReader = function(text) {
	this.index = 0;
	this.text = text;
}

koara.StringReader.prototype = {
	constructor: koara.StringReader,
	
	read: function(buffer, offset, length) {
		if(this.text.substring(this.index).length > 0) {
			var charactersRead = 0;
			for(var i=0; i < length; i++) {
				var start = this.index + i;
				var c = this.text.substring(start, start + 1);
				if(c !== '') {
					buffer[offset + i] = c;
					charactersRead++;
				}
			}
			this.index += length;
			return charactersRead;
		}
		return -1;
	}
}
{'fraction_non_alphanumeric': 0.16074600355239788, 'fraction_numerical': 0.010657193605683837, 'mean_word_length': 3.053956834532374, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '318534', 'n_tokens_mistral': 481, 'n_tokens_neox': 404, 'n_words': 87}