Skip to content

Instantly share code, notes, and snippets.

@hellokaton
Last active December 18, 2018 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellokaton/c39a099599cb4a9d77adb1bb68593c26 to your computer and use it in GitHub Desktop.
Save hellokaton/c39a099599cb4a9d77adb1bb68593c26 to your computer and use it in GitHub Desktop.
AI核心代码,估值一个亿 Clojure 版本,4行代码实现
(loop [value (read-line)]
(if (not= value "exit")
(do (prn (clojure.string/replace value #"吗|?|\?" {"吗" "", "?" "!", "?" "!"}))
(recur (read-line)))))
;; (ai)
;; Hello?
;; 能听懂汉语吗?
;; 真的是人工智能?
;; function define
;; (defn ai []
;; (loop [value (read-line)]
;; (if (not= value "exit")
;; (do (prn (clojure.string/replace value #"吗|?|\?" {"吗" "", "?" "!", "?" "!"}))
;; (recur (read-line))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment