Conversation
|
Russian ideally should work the same way all other languages work IMO. Technically, couldn't any of the languages have a masked version or is this something specific to Russian? |
Yeah I agree! I don't think it's specific to Russian, this could be done on any other language. So if we support it on Russian we should support it on any other language. So I agree with not supporting masked profanities (At least for now). Should I work on this? |
|
One more thing that I am not sure about is if we need to normalize the russian text, so I am testing a bit to be sure about it, before removing or keeping it. |
Yes please! |
|
I did keep the normalisation as I found that it is necessary in some cases, as Russian uses Cyrillic system which have characters close to Latin that can be used. Example
On normalisation I relied just on similarities between letters but I am not sure if it's used like this by Russians, so I'll keep it like this for now, 'till it's found by the right person to correct it. |
|
Sounds good to me, is this ready to be merged @faissaloux? |
|
Yes 🚀 |
|
Thanks, new release tagged! 🏷️ |
In this PR I made russian detection more Pesty.
- We should use `RussianNormalizer`.
- Add `.php` extension at the end of file name.
- Does not use `pest-plugin-profanity` syntax and does not feel as Pest.
- In case of exception it throws the global `\Exception`.
- Does not display the profanity the way the package do (See image).
```php
RussianNormalizer::assertNoRussianProfanity('Tests\Fixtures\HasExplicitRussianProfanity.php');
```

- More Pesty and clean.
```php
expect('Tests\Fixtures\HasExplicitRussianProfanity')->toHaveNoProfanity(language: 'ru');
```

PS: I am not sure about the masked profanities on
`HasMaskedRussianProfanity` should they be detected or not. They are not
detected at the time. If it's the case I think I should remove that
file.
In this PR I made russian detection more Pesty.
Before
RussianNormalizer..phpextension at the end of file name.pest-plugin-profanitysyntax and does not feel as Pest.\Exception.After
PS: I am not sure about the masked profanities on
HasMaskedRussianProfanityshould they be detected or not. They are not detected at the time. If it's the case I think I should remove that file.