Пример #1
0
 def __test_29_slugify_hebrew(self):
     """
     Testing slugify from Hebrew.
     """
     res = slugify(self.hebrew_text)
     self.assertEqual(res, 'lorem-ipsum-dolor-sit-amet')
     return res
Пример #2
0
 def test_30_slugify_cyrillic(self):
     """
     Testing slugify from Cyrillic.
     """
     res = slugify(self.cyrillic_text)
     self.assertEqual(res, 'lorem-ipsum-dolor-sit-amet')
     return res
Пример #3
0
 def test_27_slugify_georgian(self):
     """
     Testing slugify from Georgian.
     """
     res = slugify(self.georgian_text)
     self.assertEqual(res, 'lorem-ipsum-dolor-sit-amet')
     return res
Пример #4
0
 def test_28_slugify_greek(self):
     """
     Testing slugify from Greek.
     """
     res = slugify(self.greek_text)
     self.assertEqual(res, 'lorem-ipsum-dolor-sit-amet')
     return res
Пример #5
0
 def test_26_slugify_armenian(self):
     """
     Testing slugify from Armenian.
     """
     res = slugify(self.armenian_text)
     self.assertEqual(res, 'lorem-ipsum-dolor-sit-amet')
     return res
Пример #6
0
 def test_28_slugify_greek(self):
     """
     Testing slugify from Greek.
     """
     res = slugify(self.greek_text)
     self.assertEqual(res, 'lorem-ipsum-dolor-sit-amet')
     return res
Пример #7
0
 def test_27_slugify_georgian(self):
     """
     Testing slugify from Georgian.
     """
     res = slugify(self.georgian_text)
     self.assertEqual(res, 'lorem-ipsum-dolor-sit-amet')
     return res
Пример #8
0
 def test_26_slugify_armenian(self):
     """
     Testing slugify from Armenian.
     """
     res = slugify(self.armenian_text)
     self.assertEqual(res, 'lorem-ipsum-dolor-sit-amet')
     return res
Пример #9
0
g_ru = TranslipsumGenerator(language_code='ru')

print '\nGenerating sentenses'
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,
Пример #10
0
g_ru = TranslipsumGenerator(language_code='ru')

print '\nGenerating sentenses'
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:'