Skip to content

fix(locale): filter inappropriate words in the en locale#1745

Merged
Shinigami92 merged 10 commits into
faker-js:nextfrom
matthewmayer:fix/filter-inappropriate-words-pt-2
Jan 18, 2023
Merged

fix(locale): filter inappropriate words in the en locale#1745
Shinigami92 merged 10 commits into
faker-js:nextfrom
matthewmayer:fix/filter-inappropriate-words-pt-2

Conversation

@matthewmayer

Copy link
Copy Markdown
Contributor

Following on from #1633

I ran the remaining words against https://github.com/zacanger/profane-words and found quite a few more words to remove.

Several of these are borderline, but the existing lists are so long I think there's little disadvantage in removing all of them.

@codecov

codecov Bot commented Jan 17, 2023

Copy link
Copy Markdown

Codecov Report

Merging #1745 (819ff1e) into next (250fbb7) will decrease coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1745      +/-   ##
==========================================
- Coverage   99.63%   99.63%   -0.01%     
==========================================
  Files        2337     2337              
  Lines      242692   242582     -110     
  Branches     1098     1098              
==========================================
- Hits       241808   241698     -110     
  Misses        863      863              
  Partials       21       21              
Impacted Files Coverage Δ
src/locales/en/word/adjective.ts 100.00% <ø> (ø)
src/locales/en/word/noun.ts 100.00% <ø> (ø)
src/locales/en/word/verb.ts 100.00% <ø> (ø)
@matthewmayer matthewmayer marked this pull request as ready for review January 17, 2023 03:15
@matthewmayer matthewmayer requested a review from a team as a code owner January 17, 2023 03:15

@ST-DDT ST-DDT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm quite unsure about the filter and being a non-native speaker doesn't really help either.

Some words gets filtered, some other don't and I have trouble understanding why.
E.g. lust got removed but lustrous didn't.

Comment thread src/locales/en/word/noun.ts
Comment thread src/locales/en/word/noun.ts
Comment thread src/locales/en/word/verb.ts Outdated
Comment thread src/locales/en/word/verb.ts Outdated
Comment thread src/locales/en/word/verb.ts Outdated
Comment thread src/locales/en/word/noun.ts Outdated
@ST-DDT ST-DDT added this to the v8.0 - Module Re-Shuffling milestone Jan 17, 2023
@ST-DDT ST-DDT added c: bug Something isn't working p: 1-normal Nothing urgent c: locale Permutes locale definitions labels Jan 17, 2023
@ST-DDT

ST-DDT commented Jan 17, 2023

Copy link
Copy Markdown
Member

Thanks for your time for checking the word lists.

@matthewmayer

Copy link
Copy Markdown
Contributor Author

Lust means strong sexual desire

Lustrous means shiny

Different etymologies!

I am a native English speaker and I can generally understand why words were removed.

@matthewmayer

Copy link
Copy Markdown
Contributor Author

sometimes the words have both innocent and slang meanings, so a beaver can be an animal or slang for female genitalia, a cracker can be a snack or a rude word for a white person.

@matthewmayer

Copy link
Copy Markdown
Contributor Author

agree with your comments about the variants, i'll go through and have a second pass later.

Comment thread src/locales/en/word/noun.ts
Comment thread src/locales/en/word/verb.ts Outdated
ST-DDT
ST-DDT previously approved these changes Jan 18, 2023

@ST-DDT ST-DDT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, but the tests are failing.

@Shinigami92

Copy link
Copy Markdown
Member

Looks like CI runs into errors

Comment thread langs.js Outdated
@ST-DDT ST-DDT added the s: accepted Accepted feature / Confirmed bug label Jan 18, 2023
@ST-DDT ST-DDT requested a review from a team January 18, 2023 11:11
@ST-DDT ST-DDT requested a review from a team January 18, 2023 11:11
@Shinigami92 Shinigami92 changed the title fix(locale): filter inappropriate words in the en locale - part 2 fix(locale): filter inappropriate words in the en locale Jan 18, 2023
@Shinigami92 Shinigami92 enabled auto-merge (squash) January 18, 2023 20:04
@Shinigami92 Shinigami92 merged commit dfa647d into faker-js:next Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: bug Something isn't working c: locale Permutes locale definitions p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug

4 participants