<commit_before># coding=utf-8
from __future__ import unicode_literals
from ..internet import Provider as InternetProvider

import re


class Provider(InternetProvider):

    free_email_domains = (
        'seznam.cz', 'gmail.com', 'email.cz', 'post.cz', 'chello.cz', 'centrum.cz', 'volny.cz',
    )

    tlds = ('cz', 'com', 'cz')

    @staticmethod
    def _to_ascii(string):
        replacements = (
            ('á', 'a'), ('Á', 'A'),
            ('č', 'c'), ('Č', 'C'),
            ('ď', 'd'), ('Ď', 'D'),
            ('é', 'e'), ('É', 'E'),
            ('ě', 'ě'), ('Ě', 'E'),
            ('í', 'i'), ('Í', 'I'),
            ('ň', 'n'), ('Ň', 'N'),
            ('ó', 'o'), ('Ó', 'O'),
            ('ř', 'r'), ('Ř', 'R'),
            ('š', 's'), ('Š', 'S'),
            ('ť', 't'), ('Ť', 'T'),
            ('ú', 'u'), ('Ú', 'U'),
            ('ů', 'u'), ('Ů', 'U'),
            ('ž', 'z'), ('Ž', 'Z'),

        )
        for search, replace in replacements:
            string = string.replace(search, replace)

        return string

    def user_name(self):
        pattern = self.random_element(self.user_name_formats)
        return self._to_ascii(
            self.bothify(self.generator.parse(pattern)
        ).lower())

    def domain_word(self):
        company = self.generator.format('company')
        company_elements = company.split(' ')
        company = self._to_ascii(company_elements.pop(0))
        return re.sub(r'\W', '', company).lower()<commit_msg>fixing missing/bad translits, better usename formats<commit_after># coding=utf-8
from __future__ import unicode_literals
from ..internet import Provider as InternetProvider

import re


class Provider(InternetProvider):

    user_name_formats = (
        '{{last_name_female}}.{{first_name_female}}',
        '{{last_name_female}}.{{first_name_female}}',
        '{{last_name_male}}.{{first_name_male}}',
        '{{last_name_male}}.{{first_name_male}}',
        '{{first_name_female}}.{{last_name_fexmale}}',
        '{{first_name_male}}.{{last_name_male}}',
        '{{first_name}}##',
        '?{{last_name}}',
        '?{{last_name}}',
        '?{{last_name}}',
    )

    email_formats = ('{{user_name}}@{{free_email_domain}}', )

    free_email_domains = (
        'seznam.cz', 'gmail.com', 'email.cz', 'post.cz', 'chello.cz', 'centrum.cz', 'volny.cz',
    )

    tlds = ('cz', 'com', 'cz')

    @staticmethod
    def _to_ascii(string):
        replacements = (
            ('á', 'a'), ('Á', 'A'),
            ('č', 'c'), ('Č', 'C'),
            ('ď', 'd'), ('Ď', 'D'),
            ('é', 'e'), ('É', 'E'),
            ('ě', 'e'), ('Ě', 'E'),
            ('í', 'i'), ('Í', 'I'),
            ('ň', 'n'), ('Ň', 'N'),
            ('ď', 'd'), ('Ď', 'D'),
            ('ť', 't'), ('Ť', 'T'),
            ('ó', 'o'), ('Ó', 'O'),
            ('ř', 'r'), ('Ř', 'R'),
            ('š', 's'), ('Š', 'S'),
            ('ť', 't'), ('Ť', 'T'),
            ('ú', 'u'), ('Ú', 'U'),
            ('ů', 'u'), ('Ů', 'U'),
            ('ý', 'y'), ('Ý', 'Y'),
            ('ž', 'z'), ('Ž', 'Z'),
        )
        for search, replace in replacements:
            string = string.replace(search, replace)

        return string

    def user_name(self):
        pattern = self.random_element(self.user_name_formats)
        return self._to_ascii(
            self.bothify(self.generator.parse(pattern)
        ).lower())

    def domain_word(self):
        company = self.generator.format('company')
        company_elements = company.split(' ')
        company = self._to_ascii(company_elements.pop(0))
        return re.sub(r'\W', '', company).lower()
{'fraction_non_alphanumeric': 0.24065355857103296, 'fraction_numerical': 0.0011077263915812794, 'mean_word_length': 2.1795774647887325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6254136', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1232, 'n_words': 263}