yoastseo
Version:
Yoast client-side content analysis
78 lines (77 loc) • 4.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _generalFeedbackStrings = require("./feedbackStrings/generalFeedbackStrings");
var _ageAssessmentStrings = require("./feedbackStrings/ageAssessmentStrings");
var _isPrecededByException = require("../helpers/isPrecededByException");
var _isFollowedByException = require("../helpers/isFollowedByException");
var _includesConsecutiveWords = require("../helpers/includesConsecutiveWords");
var _scores = require("./scores");
var _notInclusiveWhenStandalone = _interopRequireDefault(require("../helpers/notInclusiveWhenStandalone"));
var _createRuleDescriptions = require("../helpers/createRuleDescriptions");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const ageAssessments = [{
identifier: "seniorCitizen",
nonInclusivePhrases: ["senior citizen"],
inclusiveAlternatives: ["<i>older person, older citizen</i>", "<i>person older than 70</i>"],
score: _scores.SCORES.POTENTIALLY_NON_INCLUSIVE,
feedbackFormat: [_generalFeedbackStrings.orangeUnlessSomeoneWants, _ageAssessmentStrings.specificAgeGroup].join(" ")
}, {
identifier: "seniorCitizens",
nonInclusivePhrases: ["senior citizens"],
inclusiveAlternatives: ["<i>older people, older citizens</i>", "<i>people older than 70</i>"],
score: _scores.SCORES.POTENTIALLY_NON_INCLUSIVE,
feedbackFormat: [_generalFeedbackStrings.orangeUnlessSomeoneWants, _ageAssessmentStrings.specificAgeGroup].join(" ")
}, {
identifier: "agingDependants",
nonInclusivePhrases: ["aging dependants"],
inclusiveAlternatives: ["<i>older people</i>", "<i>people older than 70</i>"],
score: _scores.SCORES.POTENTIALLY_NON_INCLUSIVE,
feedbackFormat: [_generalFeedbackStrings.orangeUnlessSomeoneWants, _ageAssessmentStrings.specificAgeGroup].join(" ")
}, {
identifier: "elderly",
nonInclusivePhrases: ["elderly"],
inclusiveAlternatives: ["<i>older people</i>", "<i>people older than 70</i>"],
score: _scores.SCORES.POTENTIALLY_NON_INCLUSIVE,
feedbackFormat: [_generalFeedbackStrings.orangeUnlessSomeoneWants, _ageAssessmentStrings.specificAgeGroup].join(" ")
}, {
identifier: "senile",
nonInclusivePhrases: ["senile"],
inclusiveAlternatives: "a specific characteristic or experience if it is known (e.g. <i>has Alzheimer's</i>)",
score: _scores.SCORES.NON_INCLUSIVE,
feedbackFormat: _generalFeedbackStrings.redHarmful
}, {
identifier: "senility",
nonInclusivePhrases: ["senility"],
inclusiveAlternatives: "<i>dementia</i>",
score: _scores.SCORES.NON_INCLUSIVE,
feedbackFormat: _generalFeedbackStrings.redHarmful
}, {
identifier: "seniors",
nonInclusivePhrases: ["seniors"],
inclusiveAlternatives: ["<i>older people</i>", "<i>people older than 70</i>"],
score: _scores.SCORES.POTENTIALLY_NON_INCLUSIVE,
feedbackFormat: [_generalFeedbackStrings.orangeUnlessSomeoneWants, _ageAssessmentStrings.specificAgeGroup].join(" "),
rule: (words, nonInclusivePhrase) => {
return (0, _includesConsecutiveWords.includesConsecutiveWords)(words, nonInclusivePhrase).filter((0, _isPrecededByException.isNotPrecededByException)(words, ["high school", "college", "graduating", "juniors and"])).filter((0, _isFollowedByException.isNotFollowedByException)(words, nonInclusivePhrase, ["in high school", "in college", "who are graduating"]));
},
ruleDescription: (0, _createRuleDescriptions.notPrecededAndNotFollowed)(["high school", "college", "graduating", "juniors and"], ["in high school", "in college", "who are graduating"])
}, {
identifier: "theAged",
nonInclusivePhrases: ["the aged"],
inclusiveAlternatives: ["<i>older people</i>", "<i>people older than 70</i>"],
score: _scores.SCORES.NON_INCLUSIVE,
feedbackFormat: [_generalFeedbackStrings.redHarmful, _ageAssessmentStrings.specificAgeGroup].join(" "),
rule: (words, nonInclusivePhrase) => {
return (0, _includesConsecutiveWords.includesConsecutiveWords)(words, nonInclusivePhrase).filter((0, _notInclusiveWhenStandalone.default)(words, nonInclusivePhrase));
},
ruleDescription: _createRuleDescriptions.nonInclusiveWhenStandalone
}];
ageAssessments.forEach(assessment => {
assessment.category = "age";
assessment.learnMoreUrl = "https://yoa.st/inclusive-language-age";
});
var _default = exports.default = ageAssessments;
//# sourceMappingURL=ageAssessments.js.map