yoastseo
Version:
Yoast client-side content analysis
47 lines (45 loc) • 1.43 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _yoastseo = require("yoastseo");
var _getParticiples = _interopRequireDefault(require("../helpers/internal/getParticiples"));
var _nonPassives = _interopRequireDefault(require("../../sk/config/internal/nonPassives"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const {
values
} = _yoastseo.languageProcessing;
const {
Clause
} = values;
/**
* Creates a Clause object for the Slovak language.
*/
class SlovakClause extends Clause {
/**
* Constructor.
*
* @param {string} clauseText The text of the clause.
* @param {Array} auxiliaries The auxiliaries.
*
* @constructor
*/
constructor(clauseText, auxiliaries) {
super(clauseText, auxiliaries);
this._participles = (0, _getParticiples.default)(this.getClauseText());
this.checkParticiples();
}
/**
* Checks if any exceptions are applicable to this participle that would result in the clause not being passive.
* If no exceptions are found, the clause is passive.
*
* @returns {void}
*/
checkParticiples() {
const foundParticiples = this.getParticiples().filter(participle => !_nonPassives.default.includes(participle));
this.setPassive(foundParticiples.length > 0);
}
}
var _default = exports.default = SlovakClause;
//# sourceMappingURL=Clause.js.map