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

Implement Profanity Validator #122

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

martijn00
Copy link
Contributor

@martijn00 martijn00 commented Jul 27, 2024

Connection with issue(s)

Close #121
Close #113

Solution description

  • I've also added some more tests and improve type safety for translations.
  • Improved CI time with ±50%

Screenshots or Videos

To Do

  • Read contributing guide
  • Check the original issue to confirm it is fully satisfied
  • Add solution description to help guide reviewers
  • Add unit test to verify new or fixed behaviour
  • If apply, add documentation to code properties and package readme

Copy link

codecov bot commented Jul 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.54%. Comparing base (995b030) to head (9181cc4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #122      +/-   ##
==========================================
+ Coverage   95.11%   95.54%   +0.43%     
==========================================
  Files          94       96       +2     
  Lines        1024     1123      +99     
==========================================
+ Hits          974     1073      +99     
  Misses         50       50              
Flag Coverage Δ
unittests 95.54% <100.00%> (+0.43%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@deandreamatias
Copy link
Contributor

deandreamatias commented Jul 28, 2024

How much size increase the package this change?
Need profanity for each languages? Can't use the same List for all profanities?

@martijn00
Copy link
Contributor Author

@deandreamatias i don't know the exact size change, but it is just text so it should not be too much.

I would prefer a different list per language because they could have different profanity in that language. When setting useAllLocales it would use all of them together.

@martijn00
Copy link
Contributor Author

@deandreamatias this is ready now.

@deandreamatias
Copy link
Contributor

deandreamatias commented Jul 29, 2024

@martijn00 for me don't make sense that the validator add profanity words by default. This words could be a few or a lot, depends on app contexts.
For example, racists word couldn't be a profanity world on a report.
This validator need to be more generic in things like that, that are a lot interpretative and where change the meaning depending the context on language or country.

In another way, this PR add changes of multiple issues on same PR. Also changes something on CI. Split this changes on different PR please

@martijn00
Copy link
Contributor Author

martijn00 commented Jul 30, 2024

@deandreamatias please merge the other PR's so i can rebase this one and work on the changes.

@martijn00
Copy link
Contributor Author

@deandreamatias I've rebased the changes so it should be easier to check this one now.

Copy link
Contributor

@deandreamatias deandreamatias left a comment

Choose a reason for hiding this comment

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

The AI needs to have a lot of context in order to generate a list of profane words. Even then, it will probably fail or users will get around the validator.

This sort of thing requires human moderation rather than programming.

Comment on lines +11 to +78
'Asesinato',
'asno',
'bastardo',
'Bollera',
'Cabrón',
'Caca',
'Chupada',
'Chupapollas',
'Chupetón',
'concha',
'Concha de tu madre',
'Coño',
'Coprofagía',
'Culo',
'Drogas',
'Esperma',
'Fiesta de salchichas',
'Follador',
'Follar',
'Gilipichis',
'Gilipollas',
'Hacer una paja',
'Haciendo el amor',
'Heroína',
'Hija de puta',
'Hijaputa',
'Hijo de puta',
'Hijoputa',
'Idiota',
'Imbécil',
'infierno',
'Jilipollas',
'Kapullo',
'Lameculos',
'Maciza',
'Macizorra',
'maldito',
'Mamada',
'Marica',
'Maricón',
'Mariconazo',
'martillo',
'Mierda',
'Nazi',
'Orina',
'Pedo',
'Pendejo',
'Pervertido',
'Pezón',
'Pinche',
'Pis',
'Prostituta',
'Puta',
'Racista',
'Ramera',
'Sádico',
'Semen',
'Sexo',
'Sexo oral',
'Soplagaitas',
'Soplapollas',
'Tetas grandes',
'Tía buena',
'Travesti',
'Trio',
'Verga',
'vete a la mierda',
'Vulva'
Copy link
Contributor

Choose a reason for hiding this comment

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

There are a lot of contexts in which these words have no profane sense.

I see no point in having a default word list.
Having these words as a base will not save time for the developer who wants to make a quality or meaningful filter.

class ProfanityValidator extends BaseValidator<String> {
/// Constructor for the profanity validator.
ProfanityValidator({
List<String>? profanityList,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can make this required and remove the translated list of Profanity words

@github-actions github-actions bot removed the Stale label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TextField]: Profanity Check
2 participants