otfmacros/pymacro/word_utils.py

15 lines
481 B
Python
Raw Normal View History

2019-01-18 17:34:43 +00:00
def is_consonant(letter):
if not isinstance(letter, str):
raise ValueError("Argument 'letter' must be type str")
if len(letter) != 1:
raise ValueError("Argument 'letter' must be 1 long")
return not is_vowel(letter)
def is_vowel(letter):
if not isinstance(letter, str):
raise ValueError("Argument 'letter' must be type str")
if len(letter) != 1:
raise ValueError("Argument 'letter' must be 1 long")
return letter in 'aeiou'