<commit_before>define([
	'utils/ChordUtils'
], function(ChordUtils) {
	/**
	 * Chord Model is a core model representing a leadsheet chord
	 * @exports core/ChordModel
	 * @param {} param is an object of parameters
	 * param accept : {
	 *		note: "C",				// note is a string indicating the root pitch of chord, it also can be % or %% (for repeat) or NC for No Chords
	 *		chordType: "7",			// chordtype is a string indicating a chordtype
	 *		base: {ChordModel},		// base is a chordModel which represent a base note
	 *		parenthesis: false,		// booalean indicating if there are parenthesis or not
	 *		beat: 1,				// startbeat in the current measure (start at 1)
	 *		barNumber: 0			// start bar number (start at 0)
	 * }
	 */
	function ChordModel(param) {
		this.note = (param && param.note) ? param.note : "";
		this.chordType = (param && param.chordType) ? param.chordType : "";
		//this.base = (param && param.base) ? param.base : {};
		if (param && param.base) {
			this.setBase(param.base);
		} else {
			this.base = {};
		}
		this.parenthesis = (param && typeof param.parenthesis !== "undefined") ? param.parenthesis : false;
		this.beat = (param && typeof param.beat !== "undefined") ? param.beat : 1;
		this.barNumber = (param && typeof param.barNumber !== "undefined") ? param.barNumber : 0;
		this.chordSymbolList = getChordSymbolList();

		function getChordSymbolList() {
			function htmlDecode(value) {
				var div = document.createElement('div');
				div.innerHTML = value;
				return div.firstChild.nodeValue;
			}
			var maps = {
				"halfdim": "&#248;", //ø   //216 -> Ø
				//"M7":"&#916;",//Δ
				"dim": "&#959;"
			};
			for (var prop in maps) {
				maps[prop] = htmlDecode(maps[prop]);
			}
			return maps;
		}
	}

	ChordModel.prototype.initChord = function(param) {};

	/* Basic getter setter */
	ChordModel.prototype.getNote = function() {
		return this.note;
	};
	ChordModel.prototype.setNote = function(note) {
		if (typeof note === "undefined") {
			throw 'Undefined note';
		}
		this.note = note;
	};

	ChordModel.prototype.getChordType = function() {
		return this.chordType;
	};

	/**
	 *
	 * @param {String} chordType could be undefined, e.g. in "NC" (no chord)
	 */
	ChordModel.prototype.setChordType = function(chordType) {
		this.chordType = chordType;
	};

	ChordModel.prototype.getBase = function() {
		return this.base;
	};
	ChordModel.prototype.isEmptyBase = function() {
		return (Object.keys(this.base).length === 0) ? true : false;
	};

	ChordModel.prototype.setBase = function(chordBase) {
		if (typeof chordBase === "string" && chordBase !== "") {
			var newChord = new ChordModel();
			newChord.setChordFromString(chordBase);
			this.base = newChord;
			return;
		} else if ((typeof chordBase === "undefined" || !(chordBase instanceof ChordModel)) && chordBase !== "") {
			throw "Base don't have the correct ChordModel type";
		}
		this.base = chordBase;
	};

	ChordModel.prototype.getParenthesis = function() {
		return this.parenthesis;
	};
	ChordModel.prototype.setParenthesis = function(parenthesis) {
		this.parenthesis = !!parenthesis;
	};

	ChordModel.prototype.getBeat = function() {
		return this.beat;
	};

	ChordModel.prototype.setBeat = function(beat) {
		if (typeof beat !== "undefined" && !isNaN(beat)) {<commit_msg>integrating chord base bug fix made by Tim<commit_after>define([
	'utils/ChordUtils'
], function(ChordUtils) {
	/**
	 * Chord Model is a core model representing a leadsheet chord
	 * @exports core/ChordModel
	 * @param {} param is an object of parameters
	 * param accept : {
	 *		note: "C",				// note is a string indicating the root pitch of chord, it also can be % or %% (for repeat) or NC for No Chords
	 *		chordType: "7",			// chordtype is a string indicating a chordtype
	 *		base: {ChordModel},		// base is a chordModel which represent a base note
	 *		parenthesis: false,		// booalean indicating if there are parenthesis or not
	 *		beat: 1,				// startbeat in the current measure (start at 1)
	 *		barNumber: 0			// start bar number (start at 0)
	 * }
	 */
	function ChordModel(param) {
		this.note = (param && param.note) ? param.note : "";
		this.chordType = (param && param.chordType) ? param.chordType : "";
		//this.base = (param && param.base) ? param.base : {};
		if (param && param.base) {
			this.setBase(param.base);
		} else {
			this.base = {};
		}
		this.parenthesis = (param && typeof param.parenthesis !== "undefined") ? param.parenthesis : false;
		this.beat = (param && typeof param.beat !== "undefined") ? param.beat : 1;
		this.barNumber = (param && typeof param.barNumber !== "undefined") ? param.barNumber : 0;
		this.chordSymbolList = getChordSymbolList();

		function getChordSymbolList() {
			function htmlDecode(value) {
				var div = document.createElement('div');
				div.innerHTML = value;
				return div.firstChild.nodeValue;
			}
			var maps = {
				"halfdim": "&#248;", //ø   //216 -> Ø
				//"M7":"&#916;",//Δ
				"dim": "&#959;"
			};
			for (var prop in maps) {
				maps[prop] = htmlDecode(maps[prop]);
			}
			return maps;
		}
	}

	ChordModel.prototype.initChord = function(param) {};

	/* Basic getter setter */
	ChordModel.prototype.getNote = function() {
		return this.note;
	};
	ChordModel.prototype.setNote = function(note) {
		if (typeof note === "undefined") {
			throw 'Undefined note';
		}
		this.note = note;
	};

	ChordModel.prototype.getChordType = function() {
		return this.chordType;
	};

	/**
	 *
	 * @param {String} chordType could be undefined, e.g. in "NC" (no chord)
	 */
	ChordModel.prototype.setChordType = function(chordType) {
		this.chordType = chordType;
	};

	ChordModel.prototype.getBase = function() {
		return this.base;
	};
	ChordModel.prototype.isEmptyBase = function() {
		return (Object.keys(this.base).length === 0) ? true : false;
	};

	ChordModel.prototype.setBase = function(chordBase) {
		if (typeof chordBase === "string" && chordBase !== "") {
			this.base = new ChordModel();
             this.base.setChordFromString(chordBase);
		} else if ((typeof chordBase === "undefined" || !(chordBase instanceof ChordModel)) && chordBase !== "") {
			throw "Base don't have the correct ChordModel type";
		}
		this.base = chordBase;
	};

	ChordModel.prototype.getParenthesis = function() {
		return this.parenthesis;
	};
	ChordModel.prototype.setParenthesis = function(parenthesis) {
		this.parenthesis = !!parenthesis;
	};

	ChordModel.prototype.getBeat = function() {
		return this.beat;
	};

	ChordModel.prototype.setBeat = function(beat) {
		if (typeof beat !== "undefined" && !isNaN(beat)) {
{'fraction_non_alphanumeric': 0.1521307469069803, 'fraction_numerical': 0.006415151978005193, 'mean_word_length': 3.4363143631436315, 'pattern_counts': {'":': 6, '<': 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': '2861431', 'n_tokens_mistral': 2431, 'n_tokens_neox': 2149, 'n_words': 547}