<commit_before>/*
	@author: guokai
	@email/gtalk: <EMAIL>
	@blog/website: http://benben.cc
	@license: apache license,version 2.0
	@version: 0.2.1
*/

(function() {
	var juicer={
		version:'0.2.1'
	};

	this.__cache={};
	
	this.__escapehtml={
		__escapehash:{
			'<':'&lt;',
			'>':'&gt;',
			'"':'&quot;',
			'&':'&amp;'
		},
		__escapereplace:function(k) {
			return __escapehtml.__escapehash[k];
		},
		__escape:function(str) {
			return typeof(str)!=='string'?str:str.replace(/[&<>"]/igm,__escapehtml.__escapereplace);
		}
	};
	
	juicer.settings = {
		forstart:/{@for\s*([\w\.]*?)\s*as\s*(\w*?)}/igm,
		forend:/{@\/for}/igm,
		ifstart:/{@if\s*([^}]*?)}/igm,
		ifend:/{@\/if}/igm,
		interpolate:/\${([\s\S]+?)}/igm,
		noneencode:/\$\${([\s\S]+?)}/igm
	};
	
	juicer.template=function() {
		this.parse=function(tpl) {
			var buf=[].join('');
			
			tpl=tpl.replace(juicer.settings.forstart,function($,varname,alias) {
					return '<% for(var i=0,l='+varname+'.length;i<l;i++) {var '+alias+'='+varname+'[i]; %>';
				})
				.replace(juicer.settings.forend,'<% } %>')
				.replace(juicer.settings.ifstart,function($,condition) {
					return '<% if('+condition+') { %>';
				})
				.replace(juicer.settings.ifend,'<% } %>')
				.replace(juicer.settings.noneencode,function($,varname) {
					return '<%= '+(varname!=='.'?varname:'i')+' %>';
				})
				.replace(juicer.settings.interpolate,function($,varname) {
					return '<%= __escapehtml.__escape('+(varname!=='.'?varname:'i')+') %>';
				});
			
			buf+="var data=data||{};";
			if(options.loose===true) {
				buf+="var p=[];";
				buf+="with(data) {"+
						"p.push('" +
							tpl
								.replace(/\\/g,"\\\\")
								.replace(/[\r\t\n]/g," ")
								.split("<%").join("\t")<commit_msg>fix options after committing last revision.<commit_after>/*
	@author: guokai
	@email/gtalk: <EMAIL>
	@blog/website: http://benben.cc
	@license: apache license,version 2.0
	@version: 0.2.1
*/

(function() {
	var juicer={
		version:'0.2.1'
	};

	this.__cache={};
	
	this.__escapehtml={
		__escapehash:{
			'<':'&lt;',
			'>':'&gt;',
			'"':'&quot;',
			'&':'&amp;'
		},
		__escapereplace:function(k) {
			return __escapehtml.__escapehash[k];
		},
		__escape:function(str) {
			return typeof(str)!=='string'?str:str.replace(/[&<>"]/igm,__escapehtml.__escapereplace);
		}
	};
	
	juicer.settings = {
		forstart:/{@for\s*([\w\.]*?)\s*as\s*(\w*?)}/igm,
		forend:/{@\/for}/igm,
		ifstart:/{@if\s*([^}]*?)}/igm,
		ifend:/{@\/if}/igm,
		interpolate:/\${([\s\S]+?)}/igm,
		noneencode:/\$\${([\s\S]+?)}/igm
	};
	
	juicer.template=function() {
		this.parse=function(tpl,options) {
			var buf=[].join('');
			
			tpl=tpl.replace(juicer.settings.forstart,function($,varname,alias) {
					return '<% for(var i=0,l='+varname+'.length;i<l;i++) {var '+alias+'='+varname+'[i]; %>';
				})
				.replace(juicer.settings.forend,'<% } %>')
				.replace(juicer.settings.ifstart,function($,condition) {
					return '<% if('+condition+') { %>';
				})
				.replace(juicer.settings.ifend,'<% } %>')
				.replace(juicer.settings.noneencode,function($,varname) {
					return '<%= '+(varname!=='.'?varname:'i')+' %>';
				})
				.replace(juicer.settings.interpolate,function($,varname) {
					return '<%= __escapehtml.__escape('+(varname!=='.'?varname:'i')+') %>';
				});
			
			buf+="var data=data||{};";
			if(options && options.loose===true) {
				buf+="var p=[];";
				buf+="with(data) {"+
						"p.push('" +
							tpl
								.replace(/\\/g,"\\\\")
								.replace(/[\r\t\n]/g," ")
								.split("<%").join("\t")
{'fraction_non_alphanumeric': 0.28773718493344663, 'fraction_numerical': 0.005097706032285472, 'mean_word_length': 3.4652338811630847, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 21, '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': '3124722', 'n_tokens_mistral': 1745, 'n_tokens_neox': 1431, 'n_words': 143}