src/stringProcessing/indices.js
function( words, text ) {
	var matchedWords = [];

	forEach( words, function( word ) {
		word = stripSpaces( word );
		if ( ! matchWordInSentence( word, text ) ) {
			return;
		}
		matchedWords = matchedWords.concat( getIndicesByWord( word, text ) );
	} );
	return matchedWords;
}
function( words, text ) {
	var matchedWords = [];

	forEach( words, function( word ) {
		word = stripSpaces( word );
		if ( ! matchWordInSentence( word, text ) ) {
			return;
		}
		matchedWords = matchedWords.concat( getIndicesByWord( word, text ) );
	} );
	return matchedWords;
}
Matches string with an array, returns the word and the index it was found on.

@param {Array} words The array with strings to match.
@param {string} text The text to match the strings from the array to.
@returns {Array} The array with words, containing the index of the match and the matched string.
Returns an empty array if none are found.