From 05c6a2a21705122f0ebd95b219cb242cb787d94f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20B=20Nagy?= <20251272+BNAndras@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:31:14 -0700 Subject: [PATCH] Simplify casing --- exercises/practice/pig-latin/.meta/example.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/practice/pig-latin/.meta/example.jl b/exercises/practice/pig-latin/.meta/example.jl index 146298d9..71637c2b 100644 --- a/exercises/practice/pig-latin/.meta/example.jl +++ b/exercises/practice/pig-latin/.meta/example.jl @@ -1,6 +1,6 @@ function translate(phrase) words = split(phrase, " ") - fragments = map(translate_fragment, words) + fragments = map(translatefragment, words) join(fragments, " ") end @@ -8,7 +8,7 @@ end vowelsound = r"^([aeiou]|xr|yt)" consonantsound = r"^([^aeiou]+(?=y)|[^aeiou]?qu|[^aeiou]+)([a-z]+)" -function translate_fragment(fragment) +function translatefragment(fragment) translated = fragment if !occursin(vowelsound, fragment) translated = replace(fragment, consonantsound => s"\g<2>\g<1>")