tracks/kotlin/exercises/pig-latin/.meta/src/reference/kotlin/PigLatin.kt in trackler-2.2.1.52 vs tracks/kotlin/exercises/pig-latin/.meta/src/reference/kotlin/PigLatin.kt in trackler-2.2.1.53
- old
+ new
@@ -13,12 +13,12 @@
}
return word
}
- private val consonant = Regex("^([^aeiou]?qu|[^aeiou]+)([a-z]*)", RegexOption.IGNORE_CASE)
+ private val consonant = Regex("^([^aeiou]?qu|[^aeiouy]+|[^aeiou]+)([a-z]*)", RegexOption.IGNORE_CASE)
private fun splitInitialConsonantSound(word: String) = consonant.matchEntire(word)?.groupValues?.drop(1)
private val vowels = Regex("^([aeiou]|y[^aeiou]|xr)[a-z]*", RegexOption.IGNORE_CASE)
private fun startsWithVowelSound(word: String) = vowels.matches(word)
-}
\ No newline at end of file
+}