Skip to content

Instantly share code, notes, and snippets.

@lattejed
Created June 2, 2013 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lattejed/5693732 to your computer and use it in GitHub Desktop.
Save lattejed/5693732 to your computer and use it in GitHub Desktop.
def cons(self, i):
"""cons(i) is TRUE <=> b[i] is a consonant."""
if self.b[i] == 'a' or self.b[i] == 'e' or self.b[i] == 'i' or self.b[i] == 'o' or self.b[i] == 'u':
return 0
if self.b[i] == 'y':
if i == self.k0:
return 1
else:
return (not self.cons(i - 1))
return 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment