def _str_to_ord(content, weights):
 ordinal = 0
 for (i, c) in enumerate(content):
  ordinal += ((weights[i] * _ALPHABET.index(c)) + 1)
 return ordinal

def _str_to_ord ( content , weights ) : ordinal = 0 for ( i , c ) in enumerate ( content ) : ordinal += ( ( weights [ i ] * _ALPHABET . index ( c ) ) + 1 ) return ordinal
converts a string to its lexicographical order .