<commit_before>kity.extendClass( Minder, {
	_getCommand: function ( name ) {
		return this._commands[ name.toLowerCase() ];
	},
	_getQuery: function ( name ) {
		if ( !this._query[ name ] ) {
			var Cmd = this._getCommand( name );
			this._query[ name ] = new Cmd();
		}
		return this._query[ name ];
	},
	_queryCommand: function ( name, type ) {
		var me = this;
		var query = this._getQuery( name );
		var queryFunc = query[ name ][ "state" + type ];
		if ( queryFunc ) {
			return queryFunc( me );
		} else {
			return 0;
		}
	},
	execCommand: function ( name ) {
		var TargetCommand, command, cmdArgs, eventParams, stoped;

		TargetCommand = this._getCommand( name );
		if ( !TargetCommand ) {
			return false;
		}
		command = new TargetCommand();

		cmdArgs = Array.prototype.slice.call( arguments, 1 );

		eventParams = {
			command: command,
			commandName: name.toLowerCase(),
			commandArgs: cmdArgs
		};

		this._executingCommand = this._executingCommand || command;

		if ( this._executingCommand == command ) {

			stoped = this._fire( new MinderEvent( 'beforecommand', eventParams, true ) );

			if ( !stoped ) {

				this._fire( new MinderEvent( "precommand", eventParams, false ) );

				command.execute.apply( command, [ this ].concat( cmdArgs ) );

				this._fire( new MinderEvent( "command", eventParams, false ) );

				if ( command.isContentChanged() ) {
					this._firePharse( new MinderEvent( 'contentchange' ) );
				}
				if ( command.isSelectionChanged() ) {
					this._firePharse( new MinderEvent( 'selectionchange' ) );
				}
				this._firePharse( new MinderEvent( 'interactchange' ) );
			}

			this._executingCommand = null;
		} else {
			command.execute.apply( command, [ this ].concat( cmdArgs ) );
		}
	},

	queryCommandState: function ( name ) {
		return this._queryCommand( name, "State" );
	},

	queryCommandValue: function ( name ) {
		return this._queryCommand( name, "Value" );
	}
} );<commit_msg>命令锁逻辑修改<commit_after>kity.extendClass( Minder, {
	_getCommand: function ( name ) {
		return this._commands[ name.toLowerCase() ];
	},
	_getQuery: function ( name ) {
		if ( !this._query[ name ] ) {
			var Cmd = this._getCommand( name );
			this._query[ name ] = new Cmd();
		}
		return this._query[ name ];
	},
	_queryCommand: function ( name, type ) {
		var me = this;
		var query = this._getQuery( name );
		var queryFunc = query[ name ][ "state" + type ];
		if ( queryFunc ) {
			return queryFunc( me );
		} else {
			return 0;
		}
	},
	execCommand: function ( name ) {
		var TargetCommand, command, cmdArgs, eventParams, stoped, isTopCommand;

		TargetCommand = this._getCommand( name );
		if ( !TargetCommand ) {
			return false;
		}
		command = new TargetCommand();

		cmdArgs = Array.prototype.slice.call( arguments, 1 );

		eventParams = {
			command: command,
			commandName: name.toLowerCase(),
			commandArgs: cmdArgs
		};

		if ( !this._executingCommand ) {
			this._executingCommand = command;
			isTopCommand = true;
		} else {
			isTopCommand = false;
		}

		stoped = this._fire( new MinderEvent( 'beforecommand', eventParams, true ) );

		if ( !stoped ) {

			this._fire( new MinderEvent( "precommand", eventParams, false ) );
			command.execute.apply( command, [ this ].concat( cmdArgs ) );
			this._fire( new MinderEvent( "command", eventParams, false ) );

			// 顶级命令才触发事件
			if ( isTopCommand ) {
				if ( command.isContentChanged() ) {
					this._firePharse( new MinderEvent( 'contentchange' ) );
				}
				if ( command.isSelectionChanged() ) {
					this._firePharse( new MinderEvent( 'selectionchange' ) );
				}
				this._firePharse( new MinderEvent( 'interactchange' ) );
			}
		}

		// 顶级事件执行完毕才能清楚顶级事件的执行标记
		if ( isTopCommand ) {
			this._executingCommand = null;
		}
	},

	queryCommandState: function ( name ) {
		return this._queryCommand( name, "State" );
	},

	queryCommandValue: function ( name ) {
		return this._queryCommand( name, "Value" );
	}
} );
{'fraction_non_alphanumeric': 0.13881092115335544, 'fraction_numerical': 0.0010206685378923194, 'mean_word_length': 3.3076923076923075, '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': '4091234', 'n_tokens_mistral': 1495, 'n_tokens_neox': 1324, 'n_words': 304}