Sitemap
Anton Lytvynov

Anton Lytvynov

I run a software agency on AI agents and publish the real numbers behind it. Fractional CTO for non-technical founders. lytvynov-production.com

Php Spam Analyzer

2 min readApr 12, 2020

--

Detects words, emails, phones, sites

Press enter or click to view image in full size

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

Get Anton Lytvynov’s stories in your inbox

Join Medium for free to get updates from this writer.

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

Press enter or click to view image in full size
Press enter or click to view image in full size
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'
Press enter or click to view image in full size

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 🙏.

--

--

Written by Anton Lytvynov

I run a software agency on AI agents and publish the real numbers behind it. Fractional CTO for non-technical founders. lytvynov-production.com