src/researches/getSentenceBeginnings.js
function getSentenceBeginning( sentence, firstWordExceptions ) {
	const words = getWords( stripTags( stripSpaces( sentence ) ) );

	if ( words.length === 0 ) {
		return "";
	}

	let firstWord = words[ 0 ].toLocaleLowerCase();

	if ( firstWordExceptions.indexOf( firstWord ) > -1 && words.length > 1 ) {
		firstWord += " " + words[ 1 ];
	}

	return firstWord;
}
function getSentenceBeginning( sentence, firstWordExceptions ) {
	const words = getWords( stripTags( stripSpaces( sentence ) ) );

	if ( words.length === 0 ) {
		return "";
	}

	let firstWord = words[ 0 ].toLocaleLowerCase();

	if ( firstWordExceptions.indexOf( firstWord ) > -1 && words.length > 1 ) {
		firstWord += " " + words[ 1 ];
	}

	return firstWord;
}
Retrieves the first word from the sentence.

@param {string} sentence The sentence to retrieve the first word from.
@param {Array} firstWordExceptions Exceptions to match against.
@returns {string} The first word of the sentence.