New swear word counter script. Easier use

- Made the script working as a function for easier use in other  scripts
- flake8 proven