Php Spam Analyzer

Anton Lytvynov
2 min readApr 12, 2020

--

Detects words, emails, phones, sites

Github repository : https://github.com/alytvynov/spam-analyzer

Spam analyzer allows to detect predefined list of bad words. And the mapping of replacement.

Bad words and replace for them

Also it highlights emails, phones, sites.

Example

Input

Il est con, non ? détenté +33 6 60 58 74 74 conçue con some@gmail.com first.com second.org Con lorem ipsum

Output

'Il est <red>con</red>, non ? détenté <phone>+33 6 60 58 74 74</phone> conçue <red>con</red> <email>some@gmail.com</email> <site>first.com</site> <site>second.org</site> <red>con</red> lorem ipsum'

Tests

There are also some initial tests which prove the validity of code and it’s non regression in the future releases.

./vendor/bin/phpunit  --verbose --bootstrap  vendor/autoload.php tests;

Thank you for your attention

Thank you for your attention. If you have any questions feel free to contact me. I‘ll be glad to help you.

Need professional help in web or mobile development?
Recommendation for planning or estimation of your project?
Feel free to contact me here.

P.S. I really appreciate your like or share 🙏.

--

--

Anton Lytvynov
Anton Lytvynov

Written by Anton Lytvynov

CEO & Founder of Lytvynov Production, Senior web developer, architect, cryptocurrencies trader, https://lytvynov-production.com

No responses yet