Last active
October 6, 2015 13:40
-
-
Save danieltanfh95/68d4740da7daadd5369d to your computer and use it in GitHub Desktop.
shorter answer for bahasa f
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
test="cu/a/ca ha/ri i/ni san/gat pa/nas" | |
def split_words(sentence): | |
return map(lambda x : x.split("/"), sentence.split()) | |
def generate_f(syllable): | |
return syllable+"f"+ (syllable[1:] if syllable[0] not in "aeiou" else syllable) | |
print(" ".join("".join(map(generate_f, word)) for word in split_words(test))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment