Did I find the right examples for you? yes no

All Samples(43)  |  Call(39)  |  Derive(0)  |  Import(4)
Transliterates the text for the language given. Language code is optional in case of reversed translations (from
some script to latin).

:param str value:
:param str language_code:
:param bool reversed: If set to True, reversed translation is made.
:return str:

        def translit(value, language_code=None, reversed=False):
    """
    Transliterates the text for the language given. Language code is optional in case of reversed translations (from
    some script to latin).

    :param str value:
    :param str language_code:
    :param bool reversed: If set to True, reversed translation is made.
    :return str:
    """
    ensure_autodiscover()

    if language_code is None and reversed is False:
        raise LanguageCodeError(_("``language_code`` is optional with ``reversed`` set to True only."))

    if language_code is None:
        language_code = detect_language(value, fail_silently=False)

    cls = registry.get(language_code)

    if cls is None:
        raise LanguagePackNotFound(_("Language pack for code %s is not found." % language_code))

    language_pack = cls()
    return language_pack.translit(value, reversed=reversed)
        


src/t/r/transliterate-HEAD/example/example/foo/samples.py   transliterate(Download)
# -*- coding: utf-8 -*-
 
from transliterate.discover import autodiscover
from transliterate.conf import set_setting
from transliterate import get_available_language_codes, translit
 
print '\nTransliteration to Armenian\n---------------------------------------'
print translit(text, 'hy')
 
print '\nTransliteration to Russian\n---------------------------------------'
print translit(text, 'ru')
 
print '\nReversed transliteration from Armenian\n---------------------------------------'
print translit(u'Լօրեմ իպսում դoլoր սիտ ամետ', 'hy', reversed=True)
 
print '\nReversed transliteration from Russian\n---------------------------------------'
print translit(u'Лорем ипсум долор сит амет', 'ru', reversed=True)

src/t/r/transliterate-HEAD/example/example/foo/greekunaccented.py   transliterate(Download)
"""
 
from transliterate import translit
from transliterate.discover import autodiscover
from transliterate.base import TranslitLanguagePack, registry

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_02_translit_latin_to_armenian(self):
        """
        Test transliteration from Latin to Armenian.
        """
        res = translit(self.latin_text, 'hy')
    def test_03_translit_latin_to_georgian(self):
        """
        Test transliteration from Latin to Georgian.
        """
        res = translit(self.latin_text, 'ka')
    def test_04_translit_latin_to_greek(self):
        """
        Test transliteration from Latin to Greek.
        """
        res = translit(self.latin_text, 'el')
    def __test_05_translit_latin_to_hebrew(self):
        """
        Test transliteration from Latin to Hebrew.
        """
        res = translit(self.latin_text, 'he')

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_02_translit_latin_to_armenian(self):
        """
        Test transliteration from Latin to Armenian.
        """
        res = translit(self.latin_text, 'hy')
    def test_03_translit_latin_to_georgian(self):
        """
        Test transliteration from Latin to Georgian.
        """
        res = translit(self.latin_text, 'ka')
    def test_04_translit_latin_to_greek(self):
        """
        Test transliteration from Latin to Greek.
        """
        res = translit(self.latin_text, 'el')
    def __test_05_translit_latin_to_hebrew(self):
        """
        Test transliteration from Latin to Hebrew.
        """
        res = translit(self.latin_text, 'he')