Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for i in range(len(yale_list) - 1):
yale1 = yale_list[i]
yale2 = yale_list[i+1]
ambiguous = False
# test case 1:
if endswithoneof(yale1, ambiguous_consonants) and \
startswithoneof(yale2, vowel_letters):
ambiguous = True
# test case 2:
if not ambiguous and \
not endswithoneof(yale1, ambiguous_consonants) and \
startswithoneof(yale2, ambiguous_consonants):
ambiguous = True
output_str += yale1
if ambiguous:
output_str += '\''
output_str += yale_list[-1]
return output_str
yale1 = yale_list[i]
yale2 = yale_list[i + 1]
ambiguous = False
# test case 1:
if endswithoneof(yale1, ambiguous_consonants) and startswithoneof(
yale2, vowel_letters
):
ambiguous = True
# test case 2:
if (
not ambiguous
and not endswithoneof(yale1, ambiguous_consonants)
and startswithoneof(yale2, ambiguous_consonants)
):
ambiguous = True
output_str += yale1
if ambiguous:
output_str += "'"
output_str += yale_list[-1]
return output_str
vowel_letters = {'a', 'e', 'i', 'o', 'u',
'á', 'é', 'í', 'ó', 'ú',
'à', 'è', 'ì', 'ò', 'ù',
'ā', 'ē', 'ī', 'ō', 'ū'}
output_str = ''
for i in range(len(yale_list) - 1):
yale1 = yale_list[i]
yale2 = yale_list[i+1]
ambiguous = False
# test case 1:
if endswithoneof(yale1, ambiguous_consonants) and \
startswithoneof(yale2, vowel_letters):
ambiguous = True
# test case 2:
if not ambiguous and \
not endswithoneof(yale1, ambiguous_consonants) and \
startswithoneof(yale2, ambiguous_consonants):
ambiguous = True
output_str += yale1
if ambiguous:
output_str += '\''
output_str += yale_list[-1]
return output_str