Example #1
0
    def __test_29_mappings(self):
        """
        Testing mappings.
        """
        for language_pack in get_available_language_packs():
            print_('Testing language pack %s %s' % (language_pack.language_code, language_pack.language_name))
            print_('Reversed test:')
            for letter in language_pack.mapping[1]:
                print_(letter, ' --> ', translit(letter, language_pack.language_code, reversed=True))

            print_('Normal test:')
            for letter in language_pack.mapping[0]:
                print_(letter, ' --> ', translit(letter, language_pack.language_code))
Example #2
0
    def __test_29_mappings(self):
        """
        Testing mappings.
        """
        for language_pack in get_available_language_packs():
            print_('Testing language pack %s %s' %
                   (language_pack.language_code, language_pack.language_name))
            print_('Reversed test:')
            for letter in language_pack.mapping[1]:
                print_(
                    letter, ' --> ',
                    translit(letter,
                             language_pack.language_code,
                             reversed=True))

            print_('Normal test:')
            for letter in language_pack.mapping[0]:
                print_(letter, ' --> ',
                       translit(letter, language_pack.language_code))
Example #3
0
from transliterate.utils import detect_language

print detect_language(u'Լօրեմ իպսում դօլօր սիտ ամետ')

print detect_language(u'Лорем ипсум долор сит амет')

print '\nSlugify\n---------------------------------------'
from transliterate.utils import slugify

print slugify(u'Լօրեմ իպսում դօլօր սիտ ամետ')

print slugify(u'Лорем ипсум долор сит амет')

print slugify(u'Lorem ipsum dolor sit amet')

print '\nGeneral testing\n---------------------------------------'
from transliterate.utils import get_available_language_packs

for language_pack in get_available_language_packs():
    print 'Testing language pack %s %s' % (language_pack.language_code,
                                           language_pack.language_name)
    print 'Reversed test:'
    for letter in language_pack.mapping[1]:
        print letter, ' --> ', translit(letter,
                                        language_pack.language_code,
                                        reversed=True)

    print 'Normal test:'
    for letter in language_pack.mapping[0]:
        print letter, ' --> ', translit(letter, language_pack.language_code)
Example #4
0
print g_ru.generate_sentence()

print '\nLanguage detection\n---------------------------------------'
from transliterate.utils import detect_language

print detect_language(u'Լօրեմ իպսում դօլօր սիտ ամետ')

print detect_language(u'Лорем ипсум долор сит амет')

print '\nSlugify\n---------------------------------------'
from transliterate.utils import slugify

print slugify(u'Լօրեմ իպսում դօլօր սիտ ամետ')

print slugify(u'Лорем ипсум долор сит амет')

print slugify(u'Lorem ipsum dolor sit amet')

print '\nGeneral testing\n---------------------------------------'
from transliterate.utils import get_available_language_packs

for language_pack in get_available_language_packs():
    print 'Testing language pack %s %s' % (language_pack.language_code, language_pack.language_name)
    print 'Reversed test:'
    for letter in language_pack.mapping[1]:
        print letter, ' --> ', translit(letter, language_pack.language_code, reversed=True)

    print 'Normal test:'
    for letter in language_pack.mapping[0]:
        print letter, ' --> ', translit(letter, language_pack.language_code)