code: def compare_words_lexicographic( word_a, word_b ):
      
      # sanity check for words to be all Tamil
      if ( not all_tamil(word_a) ) or (not all_tamil(word_b)) :
          #print("## ")
          #print(word_a)
          #print(word_b)
          #print("Both operands need to be Tamil words")
          pass
      La = len(word_a)
      Lb = len(word_b)
      all_TA_letters = u"".join(tamil_letters)
      for itr in range(0,min(La,Lb)):
              pos1 = all_TA_letters.find( word_a[itr] )
              pos2 = all_TA_letters.find( word_b[itr] )
  
              if pos1 != pos2 :
                      #print  not( pos1 > pos2), pos1, pos2
                      return cmp(pos1, pos2)
  
      # result depends on if La is shorter than Lb, or 0 if La == Lb  i.e. cmp
      return cmp(La,Lb)
docs: compare words in Tamil lexicographic order