Summary:
* In DE `frühestens` and `spätestens` act implicitly as `nach` and `vor` (after and before) on times and may also appear after the time
* The rule `ruleTimeofdayTimeofdayInterval` does match `9Uhr-10` but not the
way more common expression `9-10Uhr`; added the same rule with the
second time as non-latent; actually I am not sure whether the original
rule makes sense at all
* Simple extension of `intersect by ,` to THE formal way in DE to express
a date (i.e. `Freitag, der 13.03.2013`)
General remark: I used UTF-8 characters albeit I saw that the other rules and examples use escaped hex encoding for e.g. German umlaute. If there is any reason to do that (it is not very readable), I will of course change that.
Closes https://github.com/facebookincubator/duckling/pull/19
Reviewed By: niteria
Differential Revision: D5070052
Pulled By: patapizza
fbshipit-source-id: 990ad08
Summary:
The numerical ordinal matching rule in DE is too broad. An ordinal like "1." may not be proceeded or followed by numbers.
* Added negative lookbehind - avoids matching the first "1." in "1.1" as an ordinal.
* Added negative lookahead - avoids matching the second "1." in "1.1. as an ordinal
Closes https://github.com/facebookincubator/duckling/pull/18
Reviewed By: patapizza
Differential Revision: D5069200
Pulled By: niteria
fbshipit-source-id: 0583076
Summary:
"1/0" was returning "null" -- this is not a valid fraction.
Now "1/0" returns 2 Numeral.
Reviewed By: niteria
Differential Revision: D5037579
fbshipit-source-id: 70fa4c9
Summary:
It's not quite clear how to use `Duckling.Debug` now,
see #17
Reviewed By: patapizza
Differential Revision: D5044254
fbshipit-source-id: 09f83cd
Summary:
We don't use it and it breaks `stack repl --no-load` with:
```
<interactive>:1:6: error: Not in scope: ‘>>’
<interactive>:1:70: error: Not in scope: ‘>>’
<interactive>:1:135: error: Not in scope: ‘return’
```
I need this for #17
Reviewed By: simonmar
Differential Revision: D5044232
fbshipit-source-id: fce955c
Summary:
This is analogous to
[Duckling] Don't produce trivially empty Tokens
but that change did that for intersect, this one
deals with interval.
Reviewed By: patapizza
Differential Revision: D5039215
fbshipit-source-id: 95bd821
Summary:
We already disallowed shallowly-nested intervals.
Interval of an intersection of an interval also seems
unlikely to produce anything useful.
For an input like:
"2016-Jul-29 07:00 - 2016-Jul-29 09:00 UTC"
it goes from:
```
(1.77 secs, 1,095,200,736 bytes)
```
to:
```
(1.33 secs, 857,167,480 bytes)
```
That's -25% time and -22% allocations.
Reviewed By: patapizza
Differential Revision: D5037492
fbshipit-source-id: 481dcdd
Summary:
I've found it useful for debugging to find out where
the EmptyPredicates are coming from.
This allows to change the code to track origin with minimal
amount of change.
One interesting subtlety is that we don't want to
create a new EmptyPredicate if one already exists
Reviewed By: patapizza
Differential Revision: D5037299
fbshipit-source-id: e2a2f5d
Summary:
I find it useful for debugging and adding it in
every debugging session is getting old.
Reviewed By: JonCoens
Differential Revision: D5037181
fbshipit-source-id: 7804cc5
Summary:
Also added real-world test to English `Quantity` corpus ("3/4 cup", as a culinary example)
Closes https://github.com/facebookincubator/duckling/pull/14
Reviewed By: patapizza
Differential Revision: D5035990
Pulled By: niteria
fbshipit-source-id: c1b8f65
Summary:
Turns out that `brew` can succeed installing `pcre`, but still
not install development headers in `/usr/local/include/`
if that path is not writable. `brew doctor` should find that
and related problems.
Relevant ticket: #8
Reviewed By: patapizza, JonCoens
Differential Revision: D5031503
fbshipit-source-id: ba0b8e8
Summary:
This adds a travis script, so that we get feedback when
we push or on pull requests.
It builds and runs tests.
We currently only test with GHC 8.0.2, other versions
are broken for reasons given in the script.
I relaxed the version of `time` in preparation for GHC 8.2.
It also adds an icon in the README.md
Reviewed By: JonCoens
Differential Revision: D5002255
fbshipit-source-id: 47ff3af
Summary:
I notice that there are several missing dimensions for the IT language: this patch is for the Volume dimension
Regards
Matteo
Closes https://github.com/facebookincubator/duckling/pull/4
Reviewed By: JonCoens
Differential Revision: D4986389
Pulled By: patapizza
fbshipit-source-id: 314d33e
Summary:
* moved `AmountOfMoney` up for alphabetical order
* added example request for HTTP server example
Reviewed By: JonCoens
Differential Revision: D4978108
fbshipit-source-id: e98de49
Summary:
Time dimension for Hebrew.
Commented out the failing tests that actually also fail in Clojure.
Reviewed By: JonCoens
Differential Revision: D4970308
fbshipit-source-id: b455142
Summary:
This change refactors the Engine to use a different
code path for when we're calling `lookupItem` to find
a first token `Node` matching the rule and a different
one for subsequent ones.
This division lets us get better invariants and more importantly
do full text regexp matches only when necessary.
This should be particularly useful for longer texts.
Reviewed By: patapizza
Differential Revision: D4953918
fbshipit-source-id: e3a69ad
Summary:
Duration dimension for Vietnamese.
This only uses the common rule.
Reviewed By: niteria
Differential Revision: D4962329
fbshipit-source-id: 9273245