songleash

generate chansons en laisse
git clone https://a3nm.net/git/songleash/
Log | Files | Refs

infersplit.py (944B)


      1 # OLD CODE
      2 
      3 def print_word(w, prn):
      4     s = ""
      5     vowels = False
      6     for i in range(len(w)):
      7         p = -(i+1)
      8         s += w[p]
      9         x = strip_accents(w[p])[0]
     10         if not vowels:
     11             if x in vowels_script and (i > 0 or w[-1] != 'e') and (i > 1 or w[-1] !=
     12                     's' or w[-2] != 'e') and (i > 2 or (not w.endswith('gue'))
     13                             and
     14                         not (w.endswith('que'))) and (i > 3 or (not
     15                             w.endswith('gues') and (not w.endswith('ques')))):
     16                 vowels = True
     17         else:
     18             if x not in vowels_script and x != '-':
     19                 if prn[0] in semivowels:
     20                     s = s[:-1]
     21                     break
     22                 # exception
     23                 if w[p] == 'h':
     24                     s += w[-(i+2)]
     25                 break
     26     s =  s[::-1]
     27     print ("## %s, %s, %s, %s, %s" % (w, w, w, s, s))
     28 
     29 print_word(w[0], l[i+1][1])
     30