def __test_24_language_detection_hebrew(self): """ Testing language detection. Detecting Hebrew. """ res = detect_language(self.hebrew_text) self.assertEqual(res, 'he') return res
def test_25_language_detection_cyrillic(self): """ Testing language detection. Detecting Russian (Cyrillic). """ res = detect_language(self.cyrillic_text) self.assertEqual(res, 'ru') return res
def test_22_language_detection_georgian(self): """ Testing language detection. Detecting Georgian. """ res = detect_language(self.georgian_text) self.assertEqual(res, 'ka') return res
def test_21_language_detection_armenian(self): """ Testing language detection. Detecting Amenian. """ res = detect_language(self.armenian_text) self.assertEqual(res, 'hy') return res
def test_23_language_detection_greek(self): """ Testing language detection. Detecting Greek. """ #set_setting('DEBUG', True) res = detect_language(self.greek_text) #reset_to_defaults_settings() self.assertEqual(res, 'el') return res
print '\nTransliterated lorem ipsum generator \n---------------------------------------' from transliterate.contrib.apps.translipsum import TranslipsumGenerator g_am = TranslipsumGenerator(language_code='hy') print 'Generating paragraphs' print g_am.generate_paragraph() 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