<commit_before>var ElementType = require("./ElementType.js");

function Parser(cbs, options){
	if(options) this._options = options;
	if(cbs) this._cbs = cbs;

	this._buffer = "";
	this._prevTagSep = "";
	this._stack = [];
	this._contentFlags = 0;
	this._done = false;
	this._parseState = ElementType.Text;
}

//**"Static"**//
//Regular expressions used for cleaning up and parsing (stateless)
var _reTagName = /^\s*(\/?)\s*([^\s\/]+)/; //matches tagnames
var _reAttrib = /([^=<>\"\'\s]+)\s*=\s*"([^"]*)"|([^=<>\"\'\s]+)\s*=\s*'([^']*)'|([^=<>\"\'\s]+)\s*=\s*([^'"\s]+)|([^=<>\"\'\s\/]+)/g;//"

Parser.prototype._options = {
	xmlMode: false, //Special behaviour for script/style tags by default
	lowerCaseTags: false //call .toLowerCase for each tagname
};

//**Public**//
//Methods//
//Parses a complete HTML and pushes it to the handler
Parser.prototype.parseComplete = function(data){
	this.reset();
	this.parseChunk(data);
	this.done();
};<commit_msg>Added callbacks to prototype<commit_after>var ElementType = require("./ElementType.js");

function Parser(cbs, options){
	if(options) this._options = options;
	if(cbs) this._cbs = cbs;

	this._buffer = "";
	this._prevTagSep = "";
	this._stack = [];
	this._contentFlags = 0;
	this._done = false;
	this._parseState = ElementType.Text;
}

//**"Static"**//
//Regular expressions used for cleaning up and parsing (stateless)
var _reTagName = /^\s*(\/?)\s*([^\s\/]+)/; //matches tagnames
var _reAttrib = /([^=<>\"\'\s]+)\s*=\s*"([^"]*)"|([^=<>\"\'\s]+)\s*=\s*'([^']*)'|([^=<>\"\'\s]+)\s*=\s*([^'"\s]+)|([^=<>\"\'\s\/]+)/g;//"

Parser.prototype._options = {
	xmlMode: false, //Special behaviour for script/style tags by default
	lowerCaseTags: false //call .toLowerCase for each tagname
};

Parser.prototype._cbs = {
	/*
	onopentag,
	onclosetag,
	ontext,
	onprocessinginstruction,
	oncomment
	*/
};

//**Public**//
//Methods//
//Parses a complete HTML and pushes it to the handler
Parser.prototype.parseComplete = function(data){
	this.reset();
	this.parseChunk(data);
	this.done();
};
{'fraction_non_alphanumeric': 0.2529527559055118, 'fraction_numerical': 0.000984251968503937, 'mean_word_length': 4.069825436408977, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6834789', 'n_tokens_mistral': 769, 'n_tokens_neox': 757, 'n_words': 155}