Update server.py

This commit is contained in:
Namhyeon Go 2024-02-21 15:15:41 +09:00 committed by GitHub
parent 50b15bcdab
commit 844bb2f108
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -469,8 +469,8 @@ def calculate_vowel_ratio(s):
if length == 0:
return 0.0
# Count the number of vowels ('a', 'e', 'i', 'o', 'u') in the string.
vowel_count = sum(1 for char in s if char.lower() in 'aeiou')
# Count the number of vowels ('a', 'e', 'i', 'o', 'u', 'y') in the string.
vowel_count = sum(1 for char in s if char.lower() in 'aeiouy')
# Calculate the ratio of vowels to the total length of the string.
vowel_ratio = vowel_count / length