コード例 #1
0
ファイル: test_araby.py プロジェクト: karimamer/pyarabic
    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
ファイル: kalima.py プロジェクト: linuxscout/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)
コード例 #4
0
ファイル: test_araby.py プロジェクト: karimamer/pyarabic
 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"اَلْعَرَبَيَةُ")