Skip to content

Instantly share code, notes, and snippets.

@lagenorhynque
Last active May 12, 2018 08:11
Show Gist options
  • Select an option

  • Save lagenorhynque/d17090f8c4805088e4a88c40a0c6bc45 to your computer and use it in GitHub Desktop.

Select an option

Save lagenorhynque/d17090f8c4805088e4a88c40a0c6bc45 to your computer and use it in GitHub Desktop.
(defn english->french [words]
(clojure.walk/postwalk-replace '{are vas
book livre
friend ami
hello bonjour
how comment
my mon
red rouge
you tu
today aujourd'hui}
words))
(english->french '(hello my friend - how are you today ?))
;; => (bonjour mon ami - comment vas tu aujourd'hui ?)
(defun english->french (words)
(sublis '((are . va) (book . libre) (friend . ami)
(hello . bonjour) (how . comment) (my . mon)
(red . rouge) (you. tu))
words))
(english->french '(hello my friend - how are you today?))
;; => (BONJOUR MON AMI - COMMENT VA TU TODAY?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment