UNPKG

yoastseo-dep

Version:

Yoast clientside page analysis

19 lines (15 loc) 560 B
import { includes } from "lodash-es"; import { languageProcessing } from "yoastseo-dep"; const { getWords } = languageProcessing; import participles from "../../config/internal/participles"; /** * Creates an array of participles for the participles found in a clause. * * @param {string} clauseText The sentence part to find participles in. * * @returns {Array} The list with participles. */ export default function getParticiples( clauseText ) { const words = getWords( clauseText ); return words.filter( word => includes( participles, word ) ); }