예제 #1
0
 def test_reverse_words(self):
     """ unittest for reverse a Tamil string"""
     for (
         word
     ) in u"இந்த (C) tamil முத்தையா அண்ணாமலை 2013 இந்த ஒரு எழில் தமிழ் நிரலாக்க மொழி உதாரணம்".split():
         rword = utf8.reverse_word(word)
         self.assertTrue(utf8.get_letters(rword)[0] == utf8.get_letters(word)[-1])
     return
예제 #2
0
 def test_reverse_words( self ):
     """ unittest for reverse a Tamil string"""
     print utf8.get_letters(u"இந்த")
     print u"".join(utf8.get_letters(u"இந்த"))
     for word in u"இந்த (C) tamil முத்தையா அண்ணாமலை 2013 இந்த ஒரு எழில் தமிழ் நிரலாக்க மொழி உதாரணம்".split():
         rword = utf8.reverse_word(word)
         print word,rword
         self.assertTrue( utf8.get_letters(rword)[0] == utf8.get_letters(word)[-1] )
     return
 def setSuffixes(self):
     self.replace_suffixes = {
         u"மா": u"",
         u"பேர்": u"",
         u"அதி": u"",
         u"பெரிய": u"",
         u"பெரு": u"",
         u"சின்ன": u"",
         u"ஆதி": u"",
         u"சிறு": u"",
         u"அக்": u"",
         u"இக்": u"",
         u"எக்": u"",
     }
     self.possible_suffixes = [utf8.reverse_word(word) for word in self.replace_suffixes.keys()]
예제 #4
0
 def setSuffixes(self):
     self.replace_suffixes = {
         u"மா": u"",
         u"பேர்": u"",
         u"அதி": u"",
         u"பெரிய": u"",
         u"பெரு": u"",
         u"சின்ன": u"",
         u"ஆதி": u"",
         u"சிறு": u"",
         u"அக்": u"",
         u"இக்": u"",
         u"எக்": u"",
     }
     self.possible_suffixes = [
         utf8.reverse_word(word) for word in self.replace_suffixes.keys()
     ]
 def removePrefix(self, word):
     word_lett = utf8.get_letters(word)
     word_lett.reverse()
     a, b = self.removeSuffix(u"".join(word_lett))
     return [utf8.reverse_word(a), b]
 def prepareSuffixes(self):
     assert self.possible_suffixes
     # reverse the words in each letter.
     for word in self.possible_suffixes:
         self.reversed_suffixes.append(utf8.reverse_word(word))
     return
예제 #7
0
 def reverse(self,word):
     if self.is_tamil:
         rev_word = utf8.reverse_word(word)
     else:
         rev_word = word[::-1]
     return rev_word
예제 #8
0
 def reverse(self, word):
     if self.is_tamil:
         rev_word = utf8.reverse_word(word)
     else:
         rev_word = word[::-1]
     return rev_word
예제 #9
0
 def removePrefix(self,word):
     word_lett = utf8.get_letters(word)
     word_lett.reverse()
     a,b = self.removeSuffix(u"".join(word_lett))
     return [utf8.reverse_word(a),b]
예제 #10
0
 def prepareSuffixes(self):
     assert self.possible_suffixes
     # reverse the words in each letter.
     for word in self.possible_suffixes:
         self.reversed_suffixes.append( utf8.reverse_word(word) )
     return