<commit_before>module.exports = function WFSM() {

  var	wfsm = {};

	wfsm.semirings = {}
	wfsm.semirings.real = {
		// a = abstract
		aSum: function( w1, w2 ) {
			if ( w1 == "+inf" || w2 == "+inf" ) return "+inf";
			var res = w1 + w2;
			// round to avoid weird comma values
			return Math.round( res * 10000 ) / 10000;
			return w1 + w2;
		},
		aProduct: function( w1, w2 ) {
			if ( w1 == this.a0 || w2 == this.a0 ) return this.a0;
			if ( w1 == "+inf" || w2 == "+inf" ) return "+inf";
			var res = w1 * w2;
			return Math.round( res * 10000 ) / 10000;
			return w1 * w2;
		},
		a0: 0,
		a1: 1,
		aProductClosure: function ( w ) {
			if ( w > 1 ) return "+inf";
			if ( w == 1 ) return 1;
			var res =  1 / ( 1 - w ) ;
			return Math.round( res * 10000 ) / 10000;
			return 1 / ( 1 - w ) ;
		},
		aInverse: function ( w ) {
			var res = 1 / w;
			return Math.round( res * 10000 ) / 10000;
			return 1 / w;
		}
	};

	wfsm.semirings.tropical = {
		// a = abstract
		aSum: function( w1, w2 ) {
			if ( w1 == this.a0 ) return w2;
			if ( w2 == this.a0 ) return w1;
			return Math.min(w1, w2);
		},
		aProduct: function( w1, w2 ) {
			if ( ( w1 == this.a0 ) || ( w2 == this.a0 ) ) return this.a0;
			return w1 + w2;
		},
		a0: "+inf",
		a1: 0,
		aProductClosure: function ( w ) {
			return this.a0;
		}
	};

	/*
	wfsm.EPS = -1;
	wfsm.EPS1 = -2;
	wfsm.EPS2 = -3;

	wfsm.symbols = ['a', 'b', 'c', 'd', 'e'];

	wfsm.symbols[wfsm.EPS] = 'ε';
	wfsm.symbols[wfsm.EPS1] = 'ε₁';
	wfsm.symbols[wfsm.EPS2] = 'ε₂';
	*/

	wfsm.EPS = 'ε';
	wfsm.EPS1 = 'ε₁';
	wfsm.EPS2 = 'ε₂';

	wfsm.symbols = new Set(wfsm.EPS, wfsm.EPS1, wfsm.EPS2, 'a', 'b', 'c', 'd', 'e');

	/*
	 * variable names:
	 *
	 * Q = states
	 * E = transitions
	 * F = final weight
	 * I = initial weight
	 * N = name (optional)
	 *
	 * p = source state
	 * q = target state
	 * r = next target state
	 *
	 * a = input symbol
	 * b = output symbol
	 * w = weight
	 *
	 * sr = semiring
	 *
	 */<commit_msg>Fix: Definition of symbols.<commit_after>module.exports = function WFSM() {

  var	wfsm = {};

	wfsm.semirings = {}
	wfsm.semirings.real = {
		// a = abstract
		aSum: function( w1, w2 ) {
			if ( w1 == "+inf" || w2 == "+inf" ) return "+inf";
			var res = w1 + w2;
			// round to avoid weird comma values
			return Math.round( res * 10000 ) / 10000;
			return w1 + w2;
		},
		aProduct: function( w1, w2 ) {
			if ( w1 == this.a0 || w2 == this.a0 ) return this.a0;
			if ( w1 == "+inf" || w2 == "+inf" ) return "+inf";
			var res = w1 * w2;
			return Math.round( res * 10000 ) / 10000;
			return w1 * w2;
		},
		a0: 0,
		a1: 1,
		aProductClosure: function ( w ) {
			if ( w > 1 ) return "+inf";
			if ( w == 1 ) return 1;
			var res =  1 / ( 1 - w ) ;
			return Math.round( res * 10000 ) / 10000;
			return 1 / ( 1 - w ) ;
		},
		aInverse: function ( w ) {
			var res = 1 / w;
			return Math.round( res * 10000 ) / 10000;
			return 1 / w;
		}
	};

	wfsm.semirings.tropical = {
		// a = abstract
		aSum: function( w1, w2 ) {
			if ( w1 == this.a0 ) return w2;
			if ( w2 == this.a0 ) return w1;
			return Math.min(w1, w2);
		},
		aProduct: function( w1, w2 ) {
			if ( ( w1 == this.a0 ) || ( w2 == this.a0 ) ) return this.a0;
			return w1 + w2;
		},
		a0: "+inf",
		a1: 0,
		aProductClosure: function ( w ) {
			return this.a0;
		}
	};

	/*
	wfsm.EPS = -1;
	wfsm.EPS1 = -2;
	wfsm.EPS2 = -3;

	wfsm.symbols = ['a', 'b', 'c', 'd', 'e'];

	wfsm.symbols[wfsm.EPS] = 'ε';
	wfsm.symbols[wfsm.EPS1] = 'ε₁';
	wfsm.symbols[wfsm.EPS2] = 'ε₂';
	*/

	wfsm.EPS = 'ε';
	wfsm.EPS1 = 'ε₁';
	wfsm.EPS2 = 'ε₂';

	wfsm.symbols = new Set(['a', 'b', 'c', 'd', 'e', wfsm.EPS, wfsm.EPS1, wfsm.EPS2]);

	/*
	 * variable names:
	 *
	 * Q = states
	 * E = transitions
	 * F = final weight
	 * I = initial weight
	 * N = name (optional)
	 *
	 * p = source state
	 * q = target state
	 * r = next target state
	 *
	 * a = input symbol
	 * b = output symbol
	 * w = weight
	 *
	 * sr = semiring
	 *
	 */
{'fraction_non_alphanumeric': 0.19154355578196638, 'fraction_numerical': 0.05501782985226694, 'mean_word_length': 2.14915797914996, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6558948', 'n_tokens_mistral': 2046, 'n_tokens_neox': 1712, 'n_words': 455}