<commit_before>(function(yubnubex, $, undefined) {
	var commandSplitChar = '.';
	var paramSplitChar = '`';
	

	// returns a promise containing a list of urls
	function resolveCommand(command, param) {
		if (!command) return $.when(["about:blank"]); // if the command is blank, it's going to be blank ("" signifies open a blank tab)
		
		var storedCommands = new yubnubex.CommandList();
		//todo make this more efficient?
		return storedCommands.fetch().then(function(newStoredCommands) {			
			var storedCommand = storedCommands.get(command);
			if (!storedCommand)
				return [combine(getExternalCommand(command), param)]; // if we don't have the command, go get it from yubnub
			var commandString = storedCommand.get("exec");
			
			//if it's in the internal storage, it could be any number of things:
			if (/\w+:\/\//.test(commandString)) {
				// if it's a protocol		
				return [combine(commandString, param)];
			} else if (commandString.indexOf(" ") == -1) {
				// if there are no spaces, it's a conglomerate command
				return commandString.split(commandSplitChar).map(function(subcommand) {
					return resolveCommand(subcommand, param);
				}).reduce(function(prev, current) {
					return prev.concat(current);
				}, []);
			} else {
				// if there is a space, it includes a parameter transformation
				var split = commandString.indexOf(" ");
				subcommands = commandString.substring(0, split);
				paramTransform = commandString.substring(split + 1);
				return resolveCommand(subcommands, combine(paramTransform, param, true));
			}
		});
	}
	
	function combine(url, param, alreadyEscaped) {
		if (!url) return chrome.extension.getURL('badCommand.html#unknownerror');
		if (!param) param = "";
		return url.replace('%s', alreadyEscaped ? param : escape(param));
	}

	function getExternalCommand(command) {
		var xhr = $.ajax({
			url: 'http://yubnub.org/kernel/man?args=' + command,
			async: false
		});
		
		if (xhr.status === 0) return chrome.extension.getURL('badCommand.html#nointernet');
		if (xhr.status !== 200) return chrome.extension.getURL('badCommand.html#unknownerror');
		<commit_msg>fixed multi-command aliases, e.g. s -> b.g<commit_after>(function(yubnubex, $, undefined) {
	var commandSplitChar = '.';
	var paramSplitChar = '`';
	

	// returns a promise containing a list of urls
	function resolveCommand(command, param) {
		if (!command) return $.when(["about:blank"]); // if the command is blank, it's going to be blank ("" signifies open a blank tab)
		
		var storedCommands = new yubnubex.CommandList();
		//todo make this more efficient?
		return storedCommands.fetch().then(function(newStoredCommands) {			
			var storedCommand = storedCommands.get(command);
			if (!storedCommand)
				return [combine(getExternalCommand(command), param)]; // if we don't have the command, go get it from yubnub
			var commandString = storedCommand.get("exec");
			
			//if it's in the internal storage, it could be any number of things:
			if (/\w+:\/\//.test(commandString)) {
				// if it's a protocol		
				return [combine(commandString, param)];
			} else if (commandString.indexOf(" ") == -1) {
				// if there are no spaces, it's a conglomerate command
				return $.when.apply($, 
					commandString.split(commandSplitChar).map(function(subcommand) {
						return resolveCommand(subcommand, param);
					})).then(function () {
						return Array.prototype.concat.apply([], arguments);
					});
			} else {
				// if there is a space, it includes a parameter transformation
				var split = commandString.indexOf(" ");
				subcommands = commandString.substring(0, split);
				paramTransform = commandString.substring(split + 1);
				return resolveCommand(subcommands, combine(paramTransform, param, true));
			}
		});
	}
	
	function combine(url, param, alreadyEscaped) {
		if (!url) return chrome.extension.getURL('badCommand.html#unknownerror');
		if (!param) param = "";
		return url.replace('%s', alreadyEscaped ? param : escape(param));
	}

	function getExternalCommand(command) {
		var xhr = $.ajax({
			url: 'http://yubnub.org/kernel/man?args=' + command,
			async: false
		});
		
		if (xhr.status === 0) return chrome.extension.getURL('badCommand.html#nointernet');
		if (xhr.status !== 200) return chrome.extension.getURL('badCommand.html#unknownerror');
		
{'fraction_non_alphanumeric': 0.14039580908032595, 'fraction_numerical': 0.003259604190919674, 'mean_word_length': 3.9097142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '466558', 'n_tokens_mistral': 1497, 'n_tokens_neox': 1273, 'n_words': 354}