<commit_before>// A helper class for laoding messages from a properties file inside a prototype folder, parsing them as skins and storing them in memory:

Messages = Base.extend({
	initialize: function(prototype) {
		// this is hackish: get prototype name from javascript prototype object (scope):
		var protoName = prototype.toString();
		var match = protoName.match(/\[object (\w*)\]/);
		if (match) protoName = match[1];
		// walk through all the resources of the prototype and find the resource named messages.properites
		var proto = app.__app__.getPrototypeByName(protoName);
		var name = "messages.properties";
		if (proto) {<commit_msg>Found a cleaner way to determine prototype name.<commit_after>// A helper class for laoding messages from a properties file inside a prototype folder, parsing them as skins and storing them in memory:

Messages = Base.extend({
	initialize: function(prototype) {
		// The prototype name can be accessed through the name field of the
		// constructor:
		var protoName = prototype.constructor.name;
		// walk through all the resources of the prototype and find the resource named messages.properites
		var proto = app.__app__.getPrototypeByName(protoName);
		var name = "messages.properties";
		if (proto) {
{'fraction_non_alphanumeric': 0.08493589743589744, 'fraction_numerical': 0.0008012820512820513, 'mean_word_length': 4.406926406926407, 'pattern_counts': {'":': 0, '<': 3, '<?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': '943602', 'n_tokens_mistral': 336, 'n_tokens_neox': 312, 'n_words': 145}