예제 #1
0
    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))
예제 #2
0
파일: kalima.py 프로젝트: d7eame/pyarabic
 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)
예제 #3
0
 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)
예제 #4
0
 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"اَلْعَرَبَيَةُ")