yoastseo
Version:
Yoast client-side content analysis
28 lines (27 loc) • 788 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = regularParticiples;
var _lodash = require("lodash");
/**
* Returns words that have been determined to be a regular participle.
*
* @param {string} word The word to check.
* @param {RegExp[]} regexes The regular participle regexes to match.
*
* @returns {Array} A list with the matches.
*/
function regularParticiples(word, regexes) {
// Matches word with language-specific participle regexes.
let matches = [];
regexes.forEach(function (regex) {
const match = word.match(regex);
if (match !== null) {
matches.push(match);
}
});
matches = (0, _lodash.flattenDeep)(matches);
return matches;
}
//# sourceMappingURL=matchRegularParticiples.js.map