Skip to content

Instantly share code, notes, and snippets.

@danieltanfh95
Last active October 6, 2015 13:40
Show Gist options
  • Save danieltanfh95/68d4740da7daadd5369d to your computer and use it in GitHub Desktop.
Save danieltanfh95/68d4740da7daadd5369d to your computer and use it in GitHub Desktop.
shorter answer for bahasa f
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