Created
March 23, 2015 18:57
-
-
Save CliffordAnderson/076b5e82f1d7e22e05ca to your computer and use it in GitHub Desktop.
Basic Pig Latin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.0"; | |
(: Takes a word in English and converts it to its equivalent in Pig Latin :) | |
let $word := "air" | |
let $vowels := ("a","e","i","o","u","y") | |
let $first-letter := fn:lower-case(fn:substring($word,1,1)) | |
return | |
if ($first-letter = $vowels) then $word || "ay" | |
else fn:substring($word,2) || $first-letter || "ay" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment