Skip to content

Commit

Permalink
Merge pull request #20761 from Yoast/inclusive/improve-normal-abnormal
Browse files Browse the repository at this point in the history
Inclusive language: Improves the feedback for 'normal' and 'abnormal'
  • Loading branch information
FAMarfuaty authored Oct 13, 2023
2 parents a7f83d2 + 7b35041 commit e72c623
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,51 +27,37 @@ describe( "Checks various conditions for the 'normal' and 'abnormal' assessments
},
{
identifier: "normal",
text: "This isn't normal behaviour children.",
expectedFeedback: "Avoid using <i>normal</i> as it is potentially harmful. " +
"Consider using an alternative, such as <i>typical</i> or a specific characteristic or experience if it is known. " +
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
expectedScore: 3,
},
{
identifier: "normal",
text: "This isn't normal behavior children.",
text: "He is a mentally normal person.",
expectedFeedback: "Avoid using <i>normal</i> as it is potentially harmful. " +
"Consider using an alternative, such as <i>typical</i> or a specific characteristic or experience if it is known. " +
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
expectedScore: 3,
},
{
identifier: "normal",
text: "He is a mentally normal person.",
text: "I'm afraid this isn't psychologically normal.",
expectedFeedback: "Avoid using <i>normal</i> as it is potentially harmful. " +
"Consider using an alternative, such as <i>typical</i> or a specific characteristic or experience if it is known. " +
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
expectedScore: 3,
},
{
identifier: "normal",
identifier: "behaviorallyNormal",
text: "I'm afraid this isn't behaviorally normal.",
expectedFeedback: "Avoid using <i>normal</i> as it is potentially harmful. " +
"Consider using an alternative, such as <i>typical</i> or a specific characteristic or experience if it is known. " +
expectedFeedback: "Be careful when using <i>behaviorally normal</i> as it is potentially harmful. " +
"Unless you are referring to objects or animals, consider using an alternative, such as <i>showing typical behavior</i> " +
"or a specific characteristic or experience if it is known. " +
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
expectedScore: 3,
expectedScore: 6,
},
{
identifier: "normal",
identifier: "behaviorallyNormal",
text: "I'm afraid this isn't behaviourally normal.",
expectedFeedback: "Avoid using <i>normal</i> as it is potentially harmful. " +
"Consider using an alternative, such as <i>typical</i> or a specific characteristic or experience if it is known. " +
expectedFeedback: "Be careful when using <i>behaviourally normal</i> as it is potentially harmful. " +
"Unless you are referring to objects or animals, consider using an alternative, such as <i>showing typical behavior</i> " +
"or a specific characteristic or experience if it is known. " +
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
expectedScore: 3,
},
{
identifier: "normal",
text: "I'm afraid this isn't psychologically normal.",
expectedFeedback: "Avoid using <i>normal</i> as it is potentially harmful. " +
"Consider using an alternative, such as <i>typical</i> or a specific characteristic or experience if it is known. " +
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
expectedScore: 3,
expectedScore: 6,
},
];
testInclusiveLanguageAssessments( testData );
Expand All @@ -96,51 +82,49 @@ describe( "Checks various conditions for the 'normal' and 'abnormal' assessments
},
{
identifier: "abnormal",
text: "This isn't abnormal behaviour.",
expectedFeedback: "Avoid using <i>abnormal</i> as it is potentially harmful. " +
"Consider using an alternative, such as <i>atypical</i> or a specific characteristic or experience if it is known. " +
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
expectedScore: 3,
},
{
identifier: "abnormal",
text: "This isn't abnormal behavior.",
text: "He is a mentally abnormal person.",
expectedFeedback: "Avoid using <i>abnormal</i> as it is potentially harmful. " +
"Consider using an alternative, such as <i>atypical</i> or a specific characteristic or experience if it is known. " +
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
expectedScore: 3,
},
{
identifier: "abnormal",
text: "He is a mentally abnormal person.",
text: "I'm afraid this isn't psychologically abnormal.",
expectedFeedback: "Avoid using <i>abnormal</i> as it is potentially harmful. " +
"Consider using an alternative, such as <i>atypical</i> or a specific characteristic or experience if it is known. " +
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
expectedScore: 3,
},
{
identifier: "abnormal",
identifier: "behaviorallyAbnormal",
text: "I'm afraid this isn't behaviorally abnormal.",
expectedFeedback: "Avoid using <i>abnormal</i> as it is potentially harmful. " +
"Consider using an alternative, such as <i>atypical</i> or a specific characteristic or experience if it is known. " +
expectedFeedback: "Be careful when using <i>behaviorally abnormal</i> as it is potentially harmful. " +
"Unless you are referring to objects or animals, consider using an alternative, " +
"such as <i>showing atypical behavior, showing dysfunctional behavior</i> " +
"or a specific characteristic or experience if it is known. " +
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
expectedScore: 3,
expectedScore: 6,
},
{
identifier: "abnormal",
identifier: "behaviorallyAbnormal",
text: "I'm afraid this isn't behaviourally abnormal.",
expectedFeedback: "Avoid using <i>abnormal</i> as it is potentially harmful. " +
"Consider using an alternative, such as <i>atypical</i> or a specific characteristic or experience if it is known. " +
expectedFeedback: "Be careful when using <i>behaviourally abnormal</i> as it is potentially harmful. " +
"Unless you are referring to objects or animals, consider using an alternative, " +
"such as <i>showing atypical behavior, showing dysfunctional behavior</i> " +
"or a specific characteristic or experience if it is known. " +
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
expectedScore: 3,
expectedScore: 6,
},
{
identifier: "abnormal",
text: "I'm afraid this isn't psychologically abnormal.",
expectedFeedback: "Avoid using <i>abnormal</i> as it is potentially harmful. " +
"Consider using an alternative, such as <i>atypical</i> or a specific characteristic or experience if it is known. " +
identifier: "abnormalBehavior",
text: "This isn't abnormal behaviour.",
expectedFeedback: "Be careful when using <i>abnormal behaviour</i> as it is potentially harmful. " +
"Unless you are referring to objects or animals, consider using an alternative, " +
"such as <i>atypical behavior, unusual behavior</i> " +
"or a specific characteristic or experience if it is known. " +
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
expectedScore: 3,
expectedScore: 6,
},
];
testInclusiveLanguageAssessments( testData );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
potentiallyHarmfulUnless,
harmfulNonInclusive,
harmfulPotentiallyNonInclusive,
potentiallyHarmfulUnlessAnimalsObjects,
} from "./feedbackStrings";

/*
Expand Down Expand Up @@ -112,8 +113,7 @@ const cultureAssessments = [
nonInclusivePhrases: [ "oriental" ],
inclusiveAlternatives: "<i>Asian</i>. When possible, be more specific (e.g. <i>East Asian</i>)",
score: SCORES.POTENTIALLY_NON_INCLUSIVE,
feedbackFormat: harmfulPotentiallyNonInclusive + " Unless you are referring to objects or animals, " +
"consider using an alternative, such as %2$s.",
feedbackFormat: potentiallyHarmfulUnlessAnimalsObjects,
},
{
identifier: "asianAmerican",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@ export const potentiallyHarmfulUnlessNonInclusive = [ harmfulNonInclusive, alter
* "Alternatively, if talking about a specific person, use their preferred descriptor if known."
*/
export const preferredDescriptorIfKnown = "Alternatively, if talking about a specific person, use their preferred descriptor if known.";

// An additional string to target phrases that are potentially non-inclusive unless referring to animals or objects.
export const potentiallyHarmfulUnlessAnimalsObjects = [ harmfulPotentiallyNonInclusive,
"Unless you are referring to objects or animals, consider using an alternative, such as %2$s." ].join( " " );
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { SCORES } from "./scores";
import { potentiallyHarmfulUnlessAnimalsObjects } from "./feedbackStrings";

const otherAssessments = [
{
Expand All @@ -7,26 +8,47 @@ const otherAssessments = [
inclusiveAlternatives: [ "<i>marginalized groups</i>", "<i>underrepresented groups</i>", "<i>gender and sexuality minorities</i>" ],
score: SCORES.POTENTIALLY_NON_INCLUSIVE,
feedbackFormat: "Be careful when using <i>%1$s</i> as it is potentially overgeneralizing. " +
"Consider using an alternative, such as %2$s, %3$s or specific minorities, such as %4$s.",
"Consider using an alternative, such as %2$s, %3$s or specific minorities, such as %4$s.",
},
{
identifier: "normal",
nonInclusivePhrases: [ "normal person", "normal people", "normal behaviour", "normal behavior", "mentally" +
" normal", "behaviorally normal", "behaviourally normal", "psychologically normal" ],
nonInclusivePhrases: [ "normal person", "normal people", "mentally normal", "psychologically normal" ],
inclusiveAlternatives: [ "<i>typical</i>" ],
score: SCORES.NON_INCLUSIVE,
feedbackFormat: "Avoid using <i>normal</i> as it is potentially harmful. " +
"Consider using an alternative, such as %2$s or a specific characteristic or experience if it is known.",
},
{
identifier: "behaviorallyNormal",
nonInclusivePhrases: [ "behaviorally normal", "behaviourally normal" ],
inclusiveAlternatives: [ "<i>showing typical behavior</i> or a specific characteristic or experience if it is known" ],
score: SCORES.POTENTIALLY_NON_INCLUSIVE,
feedbackFormat: potentiallyHarmfulUnlessAnimalsObjects,
},
{
identifier: "abnormal",
nonInclusivePhrases: [ "abnormal person", "abnormal people", "abnormal behaviour", "abnormal behavior", "mentally" +
" abnormal", "behaviorally abnormal", "behaviourally abnormal", "psychologically abnormal" ],
nonInclusivePhrases: [ "abnormal person", "abnormal people", "mentally abnormal", "psychologically abnormal" ],
inclusiveAlternatives: [ "<i>atypical</i>" ],
score: SCORES.NON_INCLUSIVE,
feedbackFormat: "Avoid using <i>abnormal</i> as it is potentially harmful. " +
"Consider using an alternative, such as %2$s or a specific characteristic or experience if it is known.",
},
{
identifier: "behaviorallyAbnormal",
nonInclusivePhrases: [ "behaviorally abnormal", "behaviourally abnormal" ],
inclusiveAlternatives: [ "<i>showing atypical behavior, showing dysfunctional behavior</i> " +
"or a specific characteristic or experience if it is known" ],
score: SCORES.POTENTIALLY_NON_INCLUSIVE,
feedbackFormat: potentiallyHarmfulUnlessAnimalsObjects,
},
{
identifier: "abnormalBehavior",
nonInclusivePhrases: [ "abnormal behavior", "abnormal behaviour" ],
inclusiveAlternatives: [ "<i>atypical behavior, unusual behavior</i> " +
"or a specific characteristic or experience if it is known" ],
score: SCORES.POTENTIALLY_NON_INCLUSIVE,
feedbackFormat: potentiallyHarmfulUnlessAnimalsObjects,
},
];

otherAssessments.forEach( assessment => {
Expand Down

0 comments on commit e72c623

Please sign in to comment.