From: "Jesús Gabriel y Galán" Date: 2012-12-07T06:43:04+09:00 Subject: Re: Trying to get "translator" to work On Thu, Dec 6, 2012 at 8:51 PM, JD KF wrote: > So, basically, I'm trying to get the below code to work properly for > "piglatin". I have gotten it to work with mulitple words, if the word > starts with a vowel, if the word starts with a consonant, and if the > word starts with two consonants. This was a hell of a lot of trial and > error getting to this point. > > However, I am stuck and need a little help getting unstuck. One thing > about "piglatin" is that I need to turn words like "quale" into > "alequay". Also I need to have words like "square" to turn into > "aresquay". AKA, if qu shows up somewhere, I need those letters (and > any that proceed it) to shift to the back and ad an +ay to the end. > word = "squa­re" => "square" > first, secon­d = word.­match(/(.*­qu)(.*)/).­captures => ["squ", "are"] > "#{second}­#{first}ay­" => "aresquay" Jesus.