def test_seperate(self): """Test Separate function ?""" letters = u"العربية" marks = u'\u064e\u0652\u064e\u064e\u064e\u064e\u064f' word = u"اَلْعَرَبَيَةُ" l, m = ar.separate(word) self.assertEqual(ar.joint(l, m), word) self.assertEqual(ar.separate(ar.joint(letters, marks)), (letters, marks))
def __init__(self, word, marks=u""): """ Create Kalima object, if the marks is given, the word is considered as letters else the word is considered as vocalized """ if marks == u"": self.letters, self.marks = araby.separate(word) self.word = word else: self.letters = word self.marks = marks self.word = araby.joint(word, marks)
def test_joint(self): """Test Join function ?""" letters = u"العربية" marks = u'\u064e\u0652\u064e\u064e\u064e\u064e\u064f' self.assertEqual(ar.joint(letters, marks), u"اَلْعَرَبَيَةُ")