├── .build.el ├── .gitignore ├── LICENSE ├── PATENTS ├── README.md ├── bin └── add-new-language.sh ├── circle.yml ├── docs ├── _config.yml ├── api │ ├── css │ │ ├── default.css │ │ └── highlight.css │ ├── duckling.core.html │ ├── duckling.corpus.html │ ├── duckling.dev.html │ ├── duckling.engine.html │ ├── duckling.helpers.html │ ├── duckling.learn.html │ ├── duckling.ml.naivebayes.html │ ├── duckling.qa.html │ ├── duckling.resource.html │ ├── duckling.time.api.html │ ├── duckling.time.obj.html │ ├── duckling.time.pred.html │ ├── duckling.time.prod.html │ ├── duckling.util.html │ ├── index.html │ └── js │ │ ├── highlight.min.js │ │ ├── jquery.min.js │ │ └── page_effects.js └── index.md ├── project.clj ├── resources ├── languages │ ├── ar │ │ ├── corpus │ │ │ └── numbers.clj │ │ └── rules │ │ │ └── numbers.clj │ ├── da │ │ ├── corpus │ │ │ ├── numbers.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── numbers.clj │ │ │ └── time.clj │ ├── de │ │ ├── corpus │ │ │ ├── numbers.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── numbers.clj │ │ │ └── time.clj │ ├── en │ │ ├── corpus │ │ │ ├── communication.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── communication.clj │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ ├── es │ │ ├── corpus │ │ │ ├── communication.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── communication.clj │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ ├── et │ │ ├── corpus │ │ │ ├── _communication.clj │ │ │ ├── _finance.clj │ │ │ ├── _measure.clj │ │ │ ├── _temperature.clj │ │ │ ├── _time.clj │ │ │ └── numbers.clj │ │ └── rules │ │ │ ├── _communication.clj │ │ │ ├── _cycles.clj │ │ │ ├── _duration.clj │ │ │ ├── _finance.clj │ │ │ ├── _measure.clj │ │ │ ├── _temperature.clj │ │ │ ├── _time.clj │ │ │ └── numbers.clj │ ├── fr │ │ ├── corpus │ │ │ ├── communication.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── communication.clj │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ ├── ga │ │ ├── corpus │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ ├── he │ │ ├── corpus │ │ │ ├── numbers.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── numbers.clj │ │ │ └── time.clj │ ├── hr │ │ ├── corpus │ │ │ ├── communication.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── communication.clj │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ ├── id │ │ ├── corpus │ │ │ ├── finance.clj │ │ │ └── numbers.clj │ │ └── rules │ │ │ ├── finance.clj │ │ │ └── numbers.clj │ ├── it │ │ ├── corpus │ │ │ ├── communication.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── communication.clj │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ ├── ja │ │ ├── corpus │ │ │ ├── numbers.clj │ │ │ └── temperature.clj │ │ └── rules │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── numbers.clj │ │ │ └── temperature.clj │ ├── ko │ │ ├── corpus │ │ │ ├── communication.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── communication.clj │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ ├── my │ │ ├── corpus │ │ │ └── numbers.clj │ │ └── rules │ │ │ └── numbers.clj │ ├── nb │ │ ├── corpus │ │ │ ├── finance.clj │ │ │ ├── numbers.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── finance.clj │ │ │ ├── numbers.clj │ │ │ └── time.clj │ ├── nl │ │ ├── corpus │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── cycle.clj │ │ │ ├── duration.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ └── time.clj │ ├── pl │ │ ├── corpus │ │ │ ├── numbers.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── numbers.clj │ │ │ └── time.clj │ ├── pt │ │ ├── corpus │ │ │ ├── communication.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── communication.clj │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ ├── ro │ │ ├── corpus │ │ │ ├── communication.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── communication.clj │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── finance.clj │ │ │ ├── measure.clj │ │ │ ├── numbers.clj │ │ │ ├── temperature.clj │ │ │ └── time.clj │ ├── ru │ │ ├── corpus │ │ │ └── numbers.clj │ │ └── rules │ │ │ └── numbers.clj │ ├── sv │ │ ├── corpus │ │ │ ├── finance.clj │ │ │ ├── numbers.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── cycles.clj │ │ │ ├── duration.clj │ │ │ ├── finance.clj │ │ │ ├── numbers.clj │ │ │ └── time.clj │ ├── tr │ │ ├── corpus │ │ │ └── numbers.clj │ │ └── rules │ │ │ └── numbers.clj │ ├── uk │ │ ├── corpus │ │ │ └── numbers.clj │ │ └── rules │ │ │ └── numbers.clj │ ├── vi │ │ ├── corpus │ │ │ ├── finance.clj │ │ │ ├── numbers.clj │ │ │ └── time.clj │ │ └── rules │ │ │ ├── cycles.clj │ │ │ ├── finance.clj │ │ │ ├── numbers.clj │ │ │ └── time.clj │ └── zh │ │ ├── corpus │ │ ├── numbers.clj │ │ ├── temperature.clj │ │ └── time.clj │ │ └── rules │ │ ├── cycles.clj │ │ ├── duration.clj │ │ ├── numbers.clj │ │ ├── temperature.clj │ │ └── time.clj └── log4j.properties ├── src └── duckling │ ├── core.clj │ ├── corpus.clj │ ├── dev.clj │ ├── engine.clj │ ├── helpers.clj │ ├── learn.clj │ ├── ml │ └── naivebayes.clj │ ├── qa.clj │ ├── resource.clj │ ├── time │ ├── api.clj │ ├── obj.clj │ ├── pred.clj │ └── prod.clj │ └── util.clj └── test └── duckling ├── core_test.clj ├── ml └── naivebayes_test.clj ├── time ├── obj_test.clj └── pred_test.clj └── util_test.clj /.build.el: -------------------------------------------------------------------------------- 1 | ;; project settings 2 | (setq ent-project-home (file-name-directory (if load-file-name load-file-name buffer-file-name))) 3 | (setq ent-project-name "clj-duckling") 4 | (setq ent-clean-regexp "~$\\|\\.tex$") 5 | (setq ent-project-config-filename "CljDuckling.org") 6 | 7 | ;; local functions 8 | 9 | (defvar project-version) 10 | 11 | (setq project-version (ent-get-version)) 12 | 13 | 14 | ;; tasks 15 | 16 | (load ent-init-file) 17 | 18 | (task 'doc '() "build the project documentation" '(lambda (&optional x) "lein codox")) 19 | 20 | (task 'format '() "format the project" '(lambda (&optional x) "lein cljfmt fix")) 21 | 22 | (task 'check '() "check the project" '(lambda (&optional x) "lein with-profile +check checkall")) 23 | 24 | (task 'tree '() "tree dependencies" '(lambda (&optional x) "lein do clean, deps :tree")) 25 | 26 | (task 'tests '() "run tests" '(lambda (&optional x) "lein do clean, test")) 27 | 28 | (task 'libupdate () "update project libraries" '(lambda (&optional x) "lein ancient :no-colors")) 29 | 30 | (task 'package '() "package the library" '(lambda (&optional x) "lein do clean, uberjar")) 31 | 32 | 33 | ;; Local Variables: 34 | ;; no-byte-compile: t 35 | ;; no-update-autoloads: t 36 | ;; End: 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .lein-repl-history 3 | .lein-failures 4 | .nrepl-port 5 | duckling.iml 6 | pom.xml 7 | pom.xml.asc 8 | target 9 | .idea 10 | resources/export.json 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | For Duckling software 4 | 5 | Copyright (c) 2014, Wit.ai, Inc. 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | -------------------------------------------------------------------------------- /PATENTS: -------------------------------------------------------------------------------- 1 | Additional Grant of Patent Rights 2 | 3 | “Software” means the Duckling software distributed by Wit.ai, Inc. 4 | 5 | Wit.ai hereby grants you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (subject to the termination provision below) license under any rights in any patent claims owned by Facebook, to make, have made, use, sell, offer to sell, import, and otherwise transfer the Software. For avoidance of doubt, no license is granted under Facebook’s rights in any patent claims that are infringed by (i) modifications to the Software made by you or a third party, or (ii) the Software in combination with any software or other technology provided by you or a third party. 6 | 7 | The license granted hereunder will terminate, automatically and without notice, for anyone that makes any claim (including by filing any lawsuit, assertion or other action) alleging (a) direct, indirect, or contributory infringement or inducement to infringe any patent: (i) by Wit.ai or any of its subsidiaries or affiliates, whether or not such claim is related to the Software, (ii) by any party if such claim arises in whole or in part from any software, product or service of Wit.ai or any of its subsidiaries or affiliates, whether or not such claim is related to the Software, or (iii) by any party relating to the Software; or (b) that any right in any patent claim of Wit.ai is invalid or unenforceable. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | As of May 1st, 2017 the Duckling team deprecated the Clojure version in favor of [the new Duckling](https://github.com/facebookincubator/duckling). See their [blog post announcement](https://wit.ai/blog/2017/05/01/new-duckling). 4 | 5 | My intention is to continue the clojure development of the Duckling project so I forked it in this new project. 6 | 7 | # Duckling 8 | 9 | [![Clojars Project](https://clojars.org/wit/duckling/latest-version.svg)](http://clojars.org/wit/duckling) 10 | 11 | Duckling is a Clojure library that parses text into structured data: 12 | 13 | “the first Tuesday of October” => {:value "2014-10-07T00:00:00.000-07:00" 14 | :grain :day} 15 | 16 | 17 | You can try it out at https://duckling.wit.ai 18 | 19 | See [blog post announcement](https://wit.ai/blog/2014/10/01/open-source-parser-duckling) for more context. 20 | 21 | ## Getting started 22 | 23 | To use Duckling in your project, you just need two functions: `load!` to load the default configuration, and `parse` to parse a string. 24 | 25 | ```clojure 26 | (ns myproject.core 27 | (:require [duckling.core :as p])) 28 | 29 | (p/load!) ;; Load all languages 30 | 31 | (p/parse :en$core ;; core configuration for English ; see also :fr$core, :es$core, :zh$core 32 | "wake me up the last Monday of January 2015 at 6am" 33 | [:time]) ;; We are interested in :time expressions only ; see also :duration, :temperature, etc. 34 | 35 | ;; => [{:label :time 36 | ;; :start 15 37 | ;; :end 49 38 | ;; :value {:type "value", :value "2015-01-26T06:00:00.000-02:00", :grain :hour} 39 | ;; :body "last Monday of January 2015 at 6am"}] 40 | ``` 41 | 42 | See the [documentation](https://duckling.wit.ai) for more information. 43 | -------------------------------------------------------------------------------- /bin/add-new-language.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | p="$(dirname "$0")/../resources/languages" 4 | l=$p/$1 5 | mkdir "$l" 6 | mkdir "$l/corpus" 7 | mkdir "$l/rules" 8 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | deployment: 2 | master: 3 | branch: master 4 | commands: 5 | - lein deploy private -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /docs/api/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* 2 | github.com style (c) Vasily Polovnyov 3 | */ 4 | 5 | .hljs { 6 | display: block; 7 | overflow-x: auto; 8 | padding: 0.5em; 9 | color: #333; 10 | background: #f8f8f8; 11 | } 12 | 13 | .hljs-comment, 14 | .hljs-quote { 15 | color: #998; 16 | font-style: italic; 17 | } 18 | 19 | .hljs-keyword, 20 | .hljs-selector-tag, 21 | .hljs-subst { 22 | color: #333; 23 | font-weight: bold; 24 | } 25 | 26 | .hljs-number, 27 | .hljs-literal, 28 | .hljs-variable, 29 | .hljs-template-variable, 30 | .hljs-tag .hljs-attr { 31 | color: #008080; 32 | } 33 | 34 | .hljs-string, 35 | .hljs-doctag { 36 | color: #d14; 37 | } 38 | 39 | .hljs-title, 40 | .hljs-section, 41 | .hljs-selector-id { 42 | color: #900; 43 | font-weight: bold; 44 | } 45 | 46 | .hljs-subst { 47 | font-weight: normal; 48 | } 49 | 50 | .hljs-type, 51 | .hljs-class .hljs-title { 52 | color: #458; 53 | font-weight: bold; 54 | } 55 | 56 | .hljs-tag, 57 | .hljs-name, 58 | .hljs-attribute { 59 | color: #000080; 60 | font-weight: normal; 61 | } 62 | 63 | .hljs-regexp, 64 | .hljs-link { 65 | color: #009926; 66 | } 67 | 68 | .hljs-symbol, 69 | .hljs-bullet { 70 | color: #990073; 71 | } 72 | 73 | .hljs-built_in, 74 | .hljs-builtin-name { 75 | color: #0086b3; 76 | } 77 | 78 | .hljs-meta { 79 | color: #999; 80 | font-weight: bold; 81 | } 82 | 83 | .hljs-deletion { 84 | background: #fdd; 85 | } 86 | 87 | .hljs-addition { 88 | background: #dfd; 89 | } 90 | 91 | .hljs-emphasis { 92 | font-style: italic; 93 | } 94 | 95 | .hljs-strong { 96 | font-weight: bold; 97 | } 98 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: clj-duckling 3 | description: A Clojure library that parses text into structured data. 4 | --- 5 |

{{ title }}

6 |

{{ description }}

7 | 8 | API 9 | -------------------------------------------------------------------------------- /project.clj: -------------------------------------------------------------------------------- 1 | (defproject clj-duckling "0.4.25-dev" 2 | :description "A Clojure library that parses text into structured data" 3 | :license {:url "https://github.com/wit-ai/duckling" 4 | :comments "see LICENSE"} 5 | :url "https://github.com/wit-ai/duckling" 6 | :plugins [[s3-wagon-private "1.1.2"] 7 | [lein-midje "3.1.3"] 8 | [lein-codox "0.10.3"]] 9 | :repl-options {:init-ns duckling.core} 10 | :dependencies [[org.clojure/clojure "1.8.0"] 11 | [org.clojure/tools.nrepl "0.2.13"] 12 | [org.clojure/tools.logging "0.4.0"] 13 | [clj-time "0.13.0"] 14 | [prismatic/plumbing "0.5.4"]] 15 | :deploy-repositories [["clojars" {:creds :gpg}]] 16 | :profiles {:dev {:dependencies [[org.clojure/tools.trace "0.7.9"] 17 | [midje "1.8.3"] 18 | [cheshire "5.7.1"]]} 19 | :uberjar {:aot [duckling.core]}} 20 | :test-selectors {:default (complement :benchmark) 21 | :benchmark :benchmark} 22 | :scm {:name "git" 23 | :url "https://github.com/dpom/clj-duckling"} 24 | :pom-addition [:developers [:developer 25 | [:name "Dan Pomohaci"] 26 | [:url "https://github.com/dpom/clj-duckling"] 27 | [:email "dan.pomohaci@gmail.com"] 28 | [:timezone "+3"]]] 29 | :codox {:doc-paths ["docs"] 30 | :output-path "docs/api"} 31 | 32 | ) 33 | -------------------------------------------------------------------------------- /resources/languages/ar/corpus/numbers.clj: -------------------------------------------------------------------------------- 1 | ( 2 | ; Context map 3 | {} 4 | 5 | "0" 6 | "صفر" 7 | (number 0) 8 | 9 | "1" 10 | "واحد" 11 | (number 1) 12 | 13 | "4" 14 | "أربعة" 15 | (number 4) 16 | 17 | 18 | "6" 19 | "ستة" 20 | (number 6) 21 | 22 | "33" 23 | "ثلاث و ثلاثون" 24 | (number 33) 25 | 26 | "11" 27 | "إحدى عشرة" 28 | (number 11) 29 | 30 | "12" 31 | "إثنتى عشر" 32 | (number 12) 33 | 34 | "14" 35 | "أربع عشر" 36 | (number 14) 37 | 38 | "16" 39 | "ستة عشر" 40 | (number 16) 41 | 42 | "17" 43 | "سبع عشر" 44 | (number 17) 45 | 46 | "18" 47 | "ثمان عشرة" 48 | (number 18) 49 | 50 | "خمسمائة و خمسة و عشرون" 51 | "525" 52 | (number 525) 53 | 54 | "واحدة و عشرون" 55 | "21" 56 | (number 21) 57 | 58 | 59 | "أربعة و عشرون" 60 | "24" 61 | (number 24) 62 | 63 | 64 | "ستة و عشرون" 65 | "26" 66 | (number 26) 67 | 68 | "1.1" 69 | "1.10" 70 | "01.10" 71 | "1 فاصلة 1" 72 | "واحد فاصلة واحد" 73 | (number 1.1) 74 | 75 | "0.77" 76 | ".77" 77 | (number 0.77) 78 | 79 | 80 | "الثاني" 81 | (ordinal 2) 82 | 83 | "100000" 84 | "100 الف" 85 | (number 100000) 86 | 87 | "10000" 88 | "10 آلاف" 89 | (number 10000) 90 | 91 | "3 ملايين" 92 | "3000000" 93 | (number 3000000) 94 | 95 | "-1200000" 96 | (number -1200000) 97 | 98 | 99 | ) -------------------------------------------------------------------------------- /resources/languages/da/corpus/numbers.clj: -------------------------------------------------------------------------------- 1 | ( 2 | ; Context map 3 | {} 4 | 5 | "0" 6 | "nul" 7 | (number 0) 8 | 9 | "1" 10 | "én" 11 | "en" 12 | "ét" 13 | "et" 14 | (number 1) 15 | 16 | "2" 17 | "to" 18 | "et par" 19 | (number 2) 20 | 21 | "14" 22 | "fjorten" 23 | (number 14) 24 | 25 | "16" 26 | "seksten" 27 | (number 16) 28 | 29 | "17" 30 | "sytten" 31 | (number 17) 32 | 33 | "18" 34 | "atten" 35 | (number 18) 36 | 37 | "1,1" 38 | "1,10" 39 | "01,10" 40 | (number 1.1) 41 | 42 | "0,77" 43 | ",77" 44 | (number 0.77) 45 | 46 | "100.000" 47 | "100000" 48 | "100K" 49 | "100k" 50 | (number 100000) 51 | 52 | "3M" 53 | "3000K" 54 | "3000000" 55 | "3.000.000" 56 | (number 3000000) 57 | 58 | "1.200.000" 59 | "1200000" 60 | "1,2M" 61 | "1200K" 62 | ",0012G" 63 | (number 1200000) 64 | 65 | "- 1.200.000" 66 | "-1200000" 67 | "minus 1.200.000" 68 | "negativ 1200000" 69 | "-1,2M" 70 | "-1200K" 71 | "-,0012G" 72 | (number -1200000) 73 | 74 | "5 tusind" 75 | "fem tusinde" 76 | "fem tusind" 77 | (number 5000) 78 | 79 | "4." 80 | "fjerde" 81 | (ordinal 4) 82 | ) 83 | 84 | -------------------------------------------------------------------------------- /resources/languages/de/corpus/numbers.clj: -------------------------------------------------------------------------------- 1 | ( 2 | ; Context map 3 | {} 4 | 5 | "0" 6 | "null" 7 | (number 0) 8 | 9 | "1" 10 | "eins" 11 | (number 1) 12 | 13 | "3" 14 | "drei" 15 | (number 3) 16 | 17 | "30" 18 | "dreissig" 19 | (number 30) 20 | 21 | "33" 22 | "drei und dreissig" 23 | "dreiunddreissig" 24 | "0033" 25 | (number 33) 26 | 27 | "14" 28 | "vierzehn" 29 | (number 14) 30 | 31 | "16" 32 | "sechzehn" 33 | (number 16) 34 | 35 | "17" 36 | "siebzehn" 37 | (number 17) 38 | 39 | "18" 40 | "achtzehn" 41 | (number 18) 42 | 43 | "200" 44 | "zwei hundert" 45 | (number 200) 46 | 47 | "102" 48 | "hundert zwei" 49 | (number 102) 50 | 51 | 52 | "1,1" 53 | "1 komma 1" 54 | "1,10" 55 | "01,10" 56 | (number 1.1) 57 | 58 | "0,77" 59 | ",77" 60 | (number 0.77) 61 | 62 | "100.000" 63 | "100000" 64 | "100K" 65 | "100k" 66 | (number 100000) 67 | 68 | "3M" 69 | "3000K" 70 | "3000000" 71 | "3.000.000" 72 | (number 3000000) 73 | 74 | "1.200.000" 75 | "1200000" 76 | "1,2M" 77 | "1200K" 78 | ",0012G" 79 | (number 1200000) 80 | 81 | "- 1.200.000" 82 | "-1200000" 83 | "minus 1.200.000" 84 | "negativ 1200000" 85 | "-1,2M" 86 | "-1200K" 87 | "-,0012G" 88 | (number -1200000) 89 | 90 | "5 tausend" 91 | "fünf tausend" 92 | (number 5000) 93 | 94 | "zwei hundert tausend" 95 | (number 200000) 96 | 97 | ;"ein und zwanzing tausend drei hundert elf" 98 | ;(number 21311) 99 | 100 | "sieben hundert einundzwanzig tausend zwölf" 101 | (number 721012) 102 | 103 | "ein und dreissig millionen zwei hundert sechs und fünfzig tausend sieben hundert ein und zwanzig" 104 | (number 31256721) 105 | 106 | "vierter" 107 | "4ter" 108 | (ordinal 4) 109 | 110 | "1416,15" 111 | (number 1416.15) 112 | 113 | "1.416,15" 114 | (number 1416.15) 115 | 116 | "1.000.000,00" 117 | (number 1000000.00) 118 | ) 119 | -------------------------------------------------------------------------------- /resources/languages/de/rules/cycles.clj: -------------------------------------------------------------------------------- 1 | ; Cycles are like a heart beat, the next starts just when the previous ends. 2 | ; Unlike durations, they have an absolute position in the time, it's just that this position is periodic. 3 | ; Examples of phrases involving cycles: 4 | ; - this week 5 | ; - today (= this day) 6 | ; - last month 7 | ; - last 2 calendar months (last 2 months is interpreted as a duration) 8 | ; 9 | ; As soon as you put a quantity (2 months), the cycle becomes a duration. 10 | 11 | 12 | ( 13 | "second (cycle)" 14 | #"(?i)sekunden?" 15 | {:dim :cycle 16 | :grain :second} 17 | 18 | "minute (cycle)" 19 | #"(?i)minuten?" 20 | {:dim :cycle 21 | :grain :minute} 22 | 23 | "hour (cycle)" 24 | #"(?i)stunden?" 25 | {:dim :cycle 26 | :grain :hour} 27 | 28 | "day (cycle)" 29 | #"(?i)tage?n?" 30 | {:dim :cycle 31 | :grain :day} 32 | 33 | "week (cycle)" 34 | #"(?i)wochen?" 35 | {:dim :cycle 36 | :grain :week} 37 | 38 | "month (cycle)" 39 | #"(?i)monate?n?" 40 | {:dim :cycle 41 | :grain :month} 42 | 43 | "quarter (cycle)" 44 | #"(?i)quartale?" 45 | {:dim :cycle 46 | :grain :quarter} 47 | 48 | "year (cycle)" 49 | #"(?i)jahre?n?" 50 | {:dim :cycle 51 | :grain :year} 52 | 53 | "this " 54 | [#"(?i)diese(r|n|s)?|kommende(r|n|s)?" (dim :cycle)] 55 | (cycle-nth (:grain %2) 0) 56 | 57 | "last " 58 | [#"(?i)letzte(r|n|s)?|vergangene(r|n|s)?" (dim :cycle)] 59 | (cycle-nth (:grain %2) -1) 60 | 61 | "next " 62 | [#"(?i)nächste(r|n|s)?|kommende(r|n|s)?" (dim :cycle)] 63 | (cycle-nth (:grain %2) 1) 64 | 65 | "the after