Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the phrase "dumb down" and improve feedback for the word "lame" in the Inclusive language assessment #21578

Open
wants to merge 2 commits into
base: feature/inclusive-language-fixes
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ describe( "A test for Disability assessments", function() {
expect( assessment.isApplicable( mockPaper, mockResearcher ) ).toBe( false );
} );

it( "should not target 'dumb' if followed by 'down'.", () => {
const assessment = new InclusiveLanguageAssessment( assessments.find( obj => obj.identifier === "dumb" ) );

const testSentence = "They're not used to dumbing down their articles.";
const mockPaper = new Paper( testSentence );
const mockResearcher = Factory.buildMockResearcher( [ testSentence ] );

expect( assessment.isApplicable( mockPaper, mockResearcher ) ).toBe( false );
} );

it( "correctly identifies 'the disabled' which is only recognized when followed by participle or simple past tense", () => {
const mockPaper = new Paper( "the disabled worked, the better they are." );
const mockResearcher = Factory.buildMockResearcher( [ "The disabled worked, the better they are." ] );
Expand Down Expand Up @@ -550,26 +560,29 @@ describe( "a test for targeting non-inclusive phrases in disability assessments"
{
identifier: "lame",
text: "Such a lame excuse!",
expectedFeedback: "Avoid using <i>lame</i> as it is potentially harmful. Consider using an alternative, such as <i>boring, lousy, " +
"unimpressive, sad, corny</i>. <a href='https://yoa.st/inclusive-language-disability' target='_blank'>Learn more.</a>",
expectedScore: 3,
expectedFeedback: "Be careful when using <i>lame</i> as it is potentially harmful. Unless you are " +
"referring to an object, considering using an alternative. For example, <i>boring, lousy, " +
"unimpressive, sad, corny</i>. If referring to someone's disability, use an alternative such " +
"as <i>person with a disability, person who has difficulty with walking</i>. <a href='https://yoa.st/inclusive-language-disability' target='_blank'>Learn more.</a>",
expectedScore: 6,
},
{
identifier: "lamer",
text: "It is a lamer excuse compared to the previous one.",
expectedFeedback: "Avoid using <i>lamer</i> as it is potentially harmful. Consider using an alternative, such as <i>more boring, " +
"lousier, more unimpressive, sadder, cornier</i>. <a href='https://yoa.st/inclusive-language-disability' " +
"target='_blank'>Learn more.</a>",
expectedScore: 3,
expectedFeedback: "Be careful when using <i>lame</i> as it is potentially harmful. Unless you are " +
"referring to an object, considering using an alternative. For example, <i>more boring, lousier, " +
"more unimpressive, sadder, cornier</i>. If referring to someone's disability, use an alternative such " +
"as <i>person with a disability, person who has difficulty with walking</i>. <a href='https://yoa.st/inclusive-language-disability' target='_blank'>Learn more.</a>",
expectedScore: 6,
},
{
identifier: "lamest",
text: "This is the lamest excuse by far!",
expectedFeedback:
"Avoid using <i>lamest</i> as it is potentially harmful. Consider using an alternative, such as <i>most boring, " +
"lousiest, most unimpressive, saddest, corniest</i>. <a href='https://yoa.st/inclusive-language-disability'" +
" target='_blank'>Learn more.</a>",
expectedScore: 3,
expectedFeedback: "Be careful when using <i>lame</i> as it is potentially harmful. Unless you are " +
"referring to an object, considering using an alternative. For example, <i>most boring, lousiest," +
" most unimpressive, saddest, corniest</i>. If referring to someone's disability, use an alternative such " +
"as <i>person with a disability, person who has difficulty with walking</i>. <a href='https://yoa.st/inclusive-language-disability' target='_blank'>Learn more.</a>",
expectedScore: 6,
},
];

Expand Down Expand Up @@ -1129,6 +1142,55 @@ describe( "a test for targeting non-inclusive phrases in disability assessments"

testInclusiveLanguageAssessments( testData );
} );
it( "should return the appropriate score and feedback string for: 'dumb down' and its other forms", () => {
// The different forms of "dumb down" is one entry under the same identifier.
const testData = [
{
identifier: "dumbDown",
text: "They had to dumb it down for him.",
expectedFeedback: "Avoid using <i>dumb it down</i> as it is potentially harmful. Consider using an alternative, such as <i>oversimplify</i>. " +
"<a href='https://yoa.st/inclusive-language-disability' target='_blank'>Learn more.</a>",
expectedScore: 3,
},
{
identifier: "dumbDown",
text: "They dumbed it down for him.",
expectedFeedback: "Avoid using <i>dumb it down</i> as it is potentially harmful. Consider using an alternative, such as <i>oversimplify</i>. " +
"<a href='https://yoa.st/inclusive-language-disability' target='_blank'>Learn more.</a>",
expectedScore: 3,
},
{
identifier: "dumbDown",
text: "They are dumbing it down for him.",
expectedFeedback: "Avoid using <i>dumb it down</i> as it is potentially harmful. Consider using an alternative, such as <i>oversimplify</i>. " +
"<a href='https://yoa.st/inclusive-language-disability' target='_blank'>Learn more.</a>",
expectedScore: 3,
},
{
identifier: "dumbDown",
text: "They had to dumb down the reasoning for him.",
expectedFeedback: "Avoid using <i>dumb it down</i> as it is potentially harmful. Consider using an alternative, such as <i>oversimplify</i>. " +
"<a href='https://yoa.st/inclusive-language-disability' target='_blank'>Learn more.</a>",
expectedScore: 3,
},
{
identifier: "dumbDown",
text: "They dumbed down the reasoning for him.",
expectedFeedback: "Avoid using <i>dumb it down</i> as it is potentially harmful. Consider using an alternative, such as <i>oversimplify</i>. " +
"<a href='https://yoa.st/inclusive-language-disability' target='_blank'>Learn more.</a>",
expectedScore: 3,
},
{
identifier: "dumbDown",
text: "They are dumbing down the reasoning for him.",
expectedFeedback: "Avoid using <i>dumb it down</i> as it is potentially harmful. Consider using an alternative, such as <i>oversimplify</i>. " +
"<a href='https://yoa.st/inclusive-language-disability' target='_blank'>Learn more.</a>",
expectedScore: 3,
},
];

testInclusiveLanguageAssessments( testData );
} );
it( "should return the appropriate score and feedback string for: 'psycho' and its plural form", () => {
// The different forms of "psycho" is one entry under the same identifier.
const testData = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,23 +215,26 @@ const disabilityAssessments = [
{
identifier: "lame",
nonInclusivePhrases: [ "lame" ],
inclusiveAlternatives: "<i>boring, lousy, unimpressive, sad, corny</i>",
score: SCORES.NON_INCLUSIVE,
feedbackFormat: redHarmful,
inclusiveAlternatives: "<i>boring, lousy, unimpressive, sad, corny</i>, <i>person with a disability, person who has difficulty with walking</i>",
score: SCORES.POTENTIALLY_NON_INCLUSIVE,
feedbackFormat: [ "Be careful when using <i>%1$s</i> as it is potentially harmful. " +
"Unless you are referring to an object, considering using an alternative. For example, %1$s. If referring to someone's disability, use an alternative such as %2$s." ],
},
{
identifier: "lamer",
nonInclusivePhrases: [ "lamer" ],
inclusiveAlternatives: "<i>more boring, lousier, more unimpressive, sadder, cornier</i>",
score: SCORES.NON_INCLUSIVE,
feedbackFormat: redHarmful,
inclusiveAlternatives: "<i>more boring, lousier, more unimpressive, sadder, cornier</i>, <i>person with a disability, person who has difficulty with walking</i>",
score: SCORES.POTENTIALLY_NON_INCLUSIVE,
feedbackFormat: [ "Be careful when using <i>%1$s</i> as it is potentially harmful. " +
"Unless you are referring to an object, considering using an alternative. For example, %1$s. If referring to someone's disability, use an alternative such as %2$s." ],
},
{
identifier: "lamest",
nonInclusivePhrases: [ "lamest" ],
inclusiveAlternatives: "<i>most boring, lousiest, most unimpressive, saddest, corniest</i>",
score: SCORES.NON_INCLUSIVE,
feedbackFormat: redHarmful,
inclusiveAlternatives: "<i>most boring, lousiest, most unimpressive, saddest, corniest</i>, <i>person with a disability, person who has difficulty with walking</i>",
score: SCORES.POTENTIALLY_NON_INCLUSIVE,
feedbackFormat: [ "Be careful when using <i>%1$s</i> as it is potentially harmful. " +
"Unless you are referring to an object, considering using an alternative. For example, %1$s. If referring to someone's disability, use an alternative such as %2$s." ],
Comment on lines 224 to +237
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Lamer' and 'lamest' don't need the feedback for 'lame' as an object, since when 'lame' is used as a noun it wouldn't take these forms.
And I think the person with a disability, person who has difficulty with walking alternatives would need to be adapted to the comparative and superlative forms.

},
{
identifier: "commitSuicide",
Expand Down Expand Up @@ -317,6 +320,14 @@ const disabilityAssessments = [
score: SCORES.NON_INCLUSIVE,
feedbackFormat: redHarmful,
},
{
identifier: "dumbDown",
nonInclusivePhrases: [ "dumb down", "dumbing down", "dumbed down", "dumb it down", "dumbing it down",
"dumbed it down" ],
inclusiveAlternatives: "<i>oversimplify</i>",
score: SCORES.NON_INCLUSIVE,
feedbackFormat: redHarmful,
},
Comment on lines +323 to +330
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could consider splitting this up so that each form gets the alternative in a matching form of 'oversimplify'. For example 'dumbing down' -> 'oversimplifying' etc.

{
identifier: "dumb",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to add a rule to not show the feedback for 'dumb' when followed by 'down' or 'it down'.

nonInclusivePhrases: [ "dumb", "dumber", "dumbest" ],
Expand Down
Loading