Did I find the right examples for you? yes no

All Samples(14)  |  Call(12)  |  Derive(0)  |  Import(2)
Slugifies the given text. If no ``language_code`` is given, autodetects the language code from text given.

:param unicode text:
:return str:

        def slugify(text, language_code=None):
    """
    Slugifies the given text. If no ``language_code`` is given, autodetects the language code from text given.

    :param unicode text:
    :return str:
    """
    if not language_code:
        language_code = detect_language(text)
    if language_code:
        transliterated_text = translit(text, language_code, reversed=True)
        slug = unicodedata.normalize('NFKD', transliterated_text).encode('ascii', 'ignore').decode('ascii')
        slug = re.sub('[^\w\s-]', '', slug).strip().lower()
        return re.sub('[-\s]+', '-', slug)
        


src/t/r/transliterate-1.6/src/transliterate/test.py   transliterate(Download)
from transliterate import defaults
#from transliterate.utils import get_available_language_codes, translit, detect_language, slugify
from transliterate import get_available_language_codes, translit, detect_language, slugify
#from transliterate.utils import get_available_language_packs
from transliterate import get_available_language_packs
    def test_26_slugify_armenian(self):
        """
        Testing slugify from Armenian.
        """
        res = slugify(self.armenian_text)
    def test_27_slugify_georgian(self):
        """
        Testing slugify from Georgian.
        """
        res = slugify(self.georgian_text)
    def test_28_slugify_greek(self):
        """
        Testing slugify from Greek.
        """
        res = slugify(self.greek_text)
    def __test_29_slugify_hebrew(self):
        """
        Testing slugify from Hebrew.
        """
        res = slugify(self.hebrew_text)

src/t/r/transliterate-HEAD/src/transliterate/test.py   transliterate(Download)
from transliterate import defaults
#from transliterate.utils import get_available_language_codes, translit, detect_language, slugify
from transliterate import get_available_language_codes, translit, detect_language, slugify
#from transliterate.utils import get_available_language_packs
from transliterate import get_available_language_packs
    def test_26_slugify_armenian(self):
        """
        Testing slugify from Armenian.
        """
        res = slugify(self.armenian_text)
    def test_27_slugify_georgian(self):
        """
        Testing slugify from Georgian.
        """
        res = slugify(self.georgian_text)
    def test_28_slugify_greek(self):
        """
        Testing slugify from Greek.
        """
        res = slugify(self.greek_text)
    def __test_29_slugify_hebrew(self):
        """
        Testing slugify from Hebrew.
        """
        res = slugify(self.hebrew_text)