duckling_old
1.0.0
截至2017年5月1日,我们将贬低该存储库,以支持新的小鸭。请参阅我们的博客文章公告。
感谢所有贡献者!
小鸭是一个clojure库,将文本解析为结构化数据:
“the first Tuesday of October” => {:value "2014-10-07T00:00:00.000-07:00"
:grain :day}
您可以在https://duckling.wit.ai上尝试一下
有关更多上下文,请参阅我们的博客文章公告。
要在项目中使用小鸭,您只需要两个功能: load!要加载默认配置,然后parse以解析字符串。
( ns myproject.core
( :require [duckling.core :as p]))
( p/load! ) ; ; Load all languages
( p/parse :en$core ; ; core configuration for English ; see also :fr$core, :es$core, :zh$core
" wake me up the last Monday of January 2015 at 6am "
[ :time ]) ; ; We are interested in :time expressions only ; see also :duration, :temperature, etc.
; ; => [{:label :time
; ; :start 15
; ; :end 49
; ; :value {:type "value", :value "2015-01-26T06:00:00.000-02:00", :grain :hour}
; ; :body "last Monday of January 2015 at 6am"}]有关更多信息,请参见文档。