Created
July 8, 2015 18:55
-
-
Save jonatasemidio/a0109ce9b4d92d5bfdc6 to your computer and use it in GitHub Desktop.
Conversor de Português para Plutãones
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
// Definição do problema: https://gist.github.com/jonatasemidio/8b95d2c666004065c53f | |
String.metaClass.getFirstIsVowel{-> return delegate[0] ==~ /[aeiou]/} | |
'plutãones'.replace(' ','&').collect{ if(it.firstIsVowel){return it+"#"}else{return it}}.join().split('#').collect{it+'pl'+it[-1]}.join().replace('&', ' ') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment