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

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

Merged

Conversation

matthewmayer
Copy link
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
Copy link

codecov bot commented Jan 17, 2023

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
Copy link
Member

@ST-DDT ST-DDT left a comment

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.

src/locales/en/word/noun.ts Outdated Show resolved Hide resolved
src/locales/en/word/noun.ts Outdated Show resolved Hide resolved
src/locales/en/word/verb.ts Outdated Show resolved Hide resolved
src/locales/en/word/verb.ts Outdated Show resolved Hide resolved
src/locales/en/word/verb.ts Outdated Show resolved Hide resolved
src/locales/en/word/noun.ts Outdated Show resolved Hide resolved
@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
Copy link
Member

ST-DDT commented Jan 17, 2023

Thanks for your time for checking the word lists.

@matthewmayer
Copy link
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
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
Contributor Author

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

src/locales/en/word/noun.ts Outdated Show resolved Hide resolved
src/locales/en/word/verb.ts Outdated Show resolved Hide resolved
ST-DDT
ST-DDT previously approved these changes Jan 18, 2023
Copy link
Member

@ST-DDT ST-DDT left a comment

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
Member

Looks like CI runs into errors

langs.js Outdated Show resolved Hide resolved
@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
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants