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>")