Commit Graph

718 Commits

Author SHA1 Message Date
Daniel Cartwright
69d951220e Make isRangeValid take Lang as input
Summary: There are different implementations of isRangeValid that work well for different languages, thus it makes sense to facilitate having different implementations based on the language.

Reviewed By: patapizza

Differential Revision: D28362777

fbshipit-source-id: 5f2991d54af3095c8e95cf534e2dd3b4a34dee3a
2021-05-17 13:18:11 -07:00
Daniel Cartwright
7762af850a ES Numeral con
Summary:
In ES (Spanish), decimals can be expressed by `<number> con <number>`, where the whole part is to the left and the decimal part is to the right.

Resolves #615

Reviewed By: stroxler

Differential Revision: D28449722

fbshipit-source-id: caa0fb52f72f94c4a4cc456a46c25fa5f3b9b625
2021-05-14 13:50:22 -07:00
Steven Troxler
323a7df023 Rearrange Engine.hs to top-down ordering
Summary:
Make the code reflect the call graph, which looks roughly like this:
```
parseAndResolve
  runDuckling
  resolveNode
  parseString
    saturateParseString
    parseString1
      matchFirst
         ... low level stuff
      matchFirstAnywhere
         ... low level stuff
```

I found the existing order pretty hard to untangle when I was writing some architecture notes on this module, I think the new ordering will help

Reviewed By: chessai

Differential Revision: D28441933

fbshipit-source-id: 07c722aa6d4038baa7f14fec84660ecc2736ed2e
2021-05-14 11:50:03 -07:00
Daniel Cartwright
13513d30a5 Regenerate classifiers
Summary: Some classifiers were a bit out of date. They needed regenerating.

Reviewed By: girifb

Differential Revision: D28399234

fbshipit-source-id: 2780dbe5478a5386a2b6062dec8696736b3ce723
2021-05-13 14:02:35 -07:00
Steven Troxler
9151f9e1ab Specify where the note on regex + text lives
Summary:
I spent a surprising amount of time trying to figure out what
this comment was referring to because it wasn't at all clear to me
that it meant a comment in another file. Making it more specific

Reviewed By: chessai

Differential Revision: D28411103

fbshipit-source-id: 26cd29b47367a7e0d865f616f289fef570544c39
2021-05-13 11:18:11 -07:00
Steven Troxler
fcdd8047a3 Add haddock comments to Candidate
Summary:
When documenting `Types.hs` last week I got confused about what the Bool
represented here, following up on a suggestion to add a doc comment

Reviewed By: chessai

Differential Revision: D28412103

fbshipit-source-id: 01af1f0831fc3e49d4b7f5bb9a4e89c5897b3d25
2021-05-13 11:18:10 -07:00
Steven Troxler
d6587dafbb Fix excessive-free-point-style lint errors on Rank.hs
Summary: Just replace `.` with `$`, also tweaked the spacing a bit for skimmability

Reviewed By: chessai

Differential Revision: D28411898

fbshipit-source-id: d18b9ef5db99b82d150231080c89f812f709f409
2021-05-13 11:18:09 -07:00
Steven Troxler
3eafced0fa Get rid of name clash warnings in Extraction.hs
Summary: Use targeted imports to avoid clash on `node` variable name

Reviewed By: chessai

Differential Revision: D28411902

fbshipit-source-id: 4a81e35a6aa601015685ccab3f571e919e9025c8
2021-05-13 11:03:19 -07:00
leandro.guisandez@pgconocimiento.com
173d8c235f Init
Summary: Initialise Duration for CA (Catalan) language

Reviewed By: stroxler

Differential Revision: D28299352

Pulled By: chessai

fbshipit-source-id: d1d4dd186b9fbf018c83a0df4d752b29da20f04d
2021-05-12 17:33:54 -07:00
kcnhk1@gmail.com
0a2ae7d895 Add rulePrecision2
Summary: about <volume>

Reviewed By: haoxuany

Differential Revision: D28390051

Pulled By: chessai

fbshipit-source-id: a357bbd15ab77578fda477eae6303158824458da
2021-05-12 16:53:37 -07:00
leandro.guisandez@pgconocimiento.com
f10c4db112 Init
Summary: Initialise TimeGrain for CA (Catalan) language

Reviewed By: stroxler

Differential Revision: D28299113

Pulled By: chessai

fbshipit-source-id: ffcd4043554123f5de2d279ef2660db83eb9f475
2021-05-12 16:33:51 -07:00
leandro.guisandez@pgconocimiento.com
0e3d0604a2 Init
Summary: Initialise Volume for CA (Catalan) language

Reviewed By: stroxler

Differential Revision: D28298901

Pulled By: chessai

fbshipit-source-id: 72fd95062393b8b780e521b56b097b66e2263aef
2021-05-12 14:54:05 -07:00
leandro.guisandez@pgconocimiento.com
219e5600d6 Init
Summary: Initialise Temperature for CA (Catalan) language

Reviewed By: stroxler

Differential Revision: D28298423

Pulled By: chessai

fbshipit-source-id: 73b87d002196b6b707388e9f83f42591510f40eb
2021-05-12 14:02:54 -07:00
kcnhk1@gmail.com
ff342868d7 Add rulePrecision
Summary: about <distance> rule

Reviewed By: haoxuany

Differential Revision: D28389599

Pulled By: chessai

fbshipit-source-id: 237f6f8ed605ba7d22f40cd338e637ed99565e28
2021-05-12 13:32:39 -07:00
leandro.guisandez@pgconocimiento.com
1322cd69ec Init
Summary: Initialises Distance for CA (Catalan) language

Reviewed By: stroxler

Differential Revision: D28297521

Pulled By: chessai

fbshipit-source-id: eb8641568f5981ea6e2d481c305e36cdb683dcfb
2021-05-12 12:50:13 -07:00
leandro.guisandez@pgconocimiento.com
213d1f12a5 Init
Summary: Initialise AmountOfMoney for CA (Catalan) language

Reviewed By: stroxler

Differential Revision: D28296090

Pulled By: chessai

fbshipit-source-id: f02305a762ee3cbf357bbb0a65eef614d3d828c9
2021-05-12 11:32:18 -07:00
Daniel Cartwright
3e28d42a29 Nth Time of Time rules: Make it less permissive
Summary: Currently, Duckling will accept "The first christmas of next month" in this rule, which is nonsensical. This reduces the scope of the times the rule recognises, thereby limiting us to a set of more sensible resolutions.

Reviewed By: stroxler

Differential Revision: D27861417

fbshipit-source-id: 3f19700af7298a6238c59f5de0598168d4b4a3c4
2021-05-11 11:32:14 -07:00
chessai
ccdf27ad1d FR: add nth <time> of <time> rules (#596)
Summary: Pull Request resolved: https://github.com/facebook/duckling/pull/596

Reviewed By: stroxler

Differential Revision: D27722743

Pulled By: chessai

fbshipit-source-id: a9136fef2a26e87269bca8212ae07d3d7fe04977
2021-05-11 11:32:13 -07:00
Daniel Cartwright
59cb9e0879 Support legalese numerals
Summary:
Support numerals like "forty-five (45)". Commonly seen in legal documents.

There are no classifiers to regenerate.

Resolves #216

Reviewed By: stroxler

Differential Revision: D28305725

fbshipit-source-id: b9b4e160f630ce3cf462fcf9f2e575738463c313
2021-05-10 10:33:35 -07:00
Steven Troxler
0efbfe5988 Give a usable error if we fail to parse reftime parameter
Summary:
My attention was brought to this issue by the linter complaining about `read`.

The linter is just as happy with `error`, but I do think it's better to fail
with a usable error message here than with whatever error `read` gives us.

Reviewed By: chessai

Differential Revision: D28213406

fbshipit-source-id: f101d0515ee64978480bdbb873ff72d80d124969
2021-05-07 06:20:03 -07:00
Steven Troxler
4b44e969c9 Fix all name collisions on the main Types.hs
Summary:
I think they all fell into one of two categories:
- names colliding with field names, but where there was already an existing
  pattern (e.g. d for dimension, v for value) and we just had to be consistent
- cases that were best fixed by turning NamedFieldPuns on, which I did

Reviewed By: chessai

Differential Revision: D28213245

fbshipit-source-id: 18fbd61771e12da11ce03b98b74af51d1e837787
2021-05-07 06:20:03 -07:00
Steven Troxler
ce3614fedd In Debug.hs, s/sentence/input/g
Summary:
When tracing the code from Debug downward, the unnecessary rename
of an argument from `sentence` to `input` creates a context switch. Let's
use the same name throughout.

Reviewed By: chessai

Differential Revision: D28213244

fbshipit-source-id: 22476d958312e5c60cd32ff1e3d0d460cf0c8c79
2021-05-06 08:54:57 -07:00
Steven Troxler
a88b70feb7 Filter with a self-describing function in where
Summary:
In both `Api.hs` and `Debug.hs` I noticed that I was staring at the code
longer than necessary to figure out what a lambda with a destructure and
pattern match were doing. Moving it to a function in `where` named
`isRelevantDimension` makes skimming easier.

Reviewed By: chessai

Differential Revision: D28213243

fbshipit-source-id: 344f464dcac7297009c35b19373eef67e0eb9540
2021-05-06 08:54:57 -07:00
Steven Troxler
eba5d0a825 Simple style fixes for outer layers around Engine.hs
Summary:
Easy style fixes for ExampleMain.hs, Debug.hs, Api.hs, Core.hs

Most of these are just lint fixes, but I also made a few not-just-lint changes
to conform to some elements of our style guide that I agree with:
- if the type signature doesn't fit on one line, then put one type per line
  with nothing on the first line, so that all types are vertically aligned - makes
  for a quick skim
- try to avoid mixing same-line function args with hanging function args: hang
  all arguments or none at all to get a more outline-like feel, again better for
  skimming

I was actually able to eliminate all errors for most of these modules - the name
collisions I usually give up on were manageable by hiding + easy variable renames

Reviewed By: chessai

Differential Revision: D28213246

fbshipit-source-id: 1f77d56f2ff8dccfd5f3b534f087c07047b92885
2021-05-06 08:54:56 -07:00
Steven Troxler
0e13d28b4d Time/EN: Get rid of unnecessary rules
Summary:
While I was working on fixing #604, I came across the rules
`ruleMilitarySpelledOutAMPM(2)`, which were actually capturing
some of my test phrases and confusing me.

This commit removes them because
- they aren't needed: the existing latent spelled-out hour + minute rules plus
  the "(in the )?(am/pm)" rules together give the same behavior
- they are confusingly named - these aren't military times at all, they are
  spelled-out civilian times

Reviewed By: haoxuany

Differential Revision: D27848485

fbshipit-source-id: ba1ed16ec22b5139b0b500b44dc91adb1b5e3d82
2021-04-26 06:17:44 -07:00
Steven Troxler
c44c73fe04 Numeral/ES: Add support for additive concatenations
Summary:
This commit extend Spanish-language support for concatenations
of the form "<higher-order-of-magnitude> <lower>", e.g.
"doscientos tres" (203) or "cuatro mil ventiuno" (4022) to work
not just for hundreds but also for thousands and millions.

Reviewed By: chessai

Differential Revision: D27858133

fbshipit-source-id: 5c6b227ae7dad9009cd636e7ea49c209480c931a
2021-04-23 09:48:07 -07:00
Steven Troxler
888da76215 Numeral/ES: Add support for 1M, and multiples of 1K/1M
Summary:
This commit adds two things to Spanish numeral support:
- support for millions
- support, via hooking into the `isMultipliable` logic used by EN, for
  composing counts of 2-999 with either "mil" or "millones", which is
  the standard way to say things like "tres mil" = 3000

Reviewed By: chessai

Differential Revision: D27858135

fbshipit-source-id: 980e95bd989f818c5ceaa2bb6c87fe81d3e08366
2021-04-23 09:48:06 -07:00
Steven Troxler
15bba9eba9 Numeral/ES: Refactor hundreds handling to fix bug
Summary:
This diff refactors our handling of "<hundreds> 0..99" numbers
to be more flexible by replacing `ruleNumeralthreePartHundreds`
with
- a rule for two-part hundreds like "dos cientos" (which is technically
  incorrect grammar - doscientos is correct - but probably worth keeping) based
  on a notion of multipliability like that used in EN rules
- a rule stating that we can compose hundreds with 0..99 additively

The resulting rules are more flexible, and they correctly parse not only
gramatically iffy phrases like "dos cientos tres", but also grammatically
correct phrases like "doscientos tres". This fixes #380.

Reviewed By: chessai

Differential Revision: D27858136

fbshipit-source-id: 4a918d84d93ac074f83f6947a8f80cfd11145115
2021-04-23 09:48:06 -07:00
Steven Troxler
6db071069b Numeral/ES: Style fixes - names, order, etc
Summary:
Whle looking into fixing https://github.com/facebook/duckling/issues/380
I was having a bit of trouble navigating the existing rules and guessing
what is / is not supported.

This diff refactors the Numeral/ES code to be easier to navigate:
- rename all the `ruleNumeral{1,2,3,4,5,6}` rules to be descriptive
- changes the order to be themed from small to large numbers, and
  make sure the order of defines matches the order of rules at the end
  of the module
- use [20 .. 90] instead of manually specifying the same list out-of-order

Reviewed By: chessai

Differential Revision: D27858134

fbshipit-source-id: b13983d75b36bb4e2b387ef06fe61066d81ae19a
2021-04-23 09:48:06 -07:00
Steven Troxler
bf696ba185 Time/EN: Allow dashes in spelled-out times
Summary:
It's common to use dashes when spelling out times longhand,
e.g. "five-thirty am", but Duckling wasn't handling this at all.

This commit adds rules for times spelled out with dashes. The
rules explicitly forbid the second of the two times from including
digits via a negative match. This is because
- it wouldn't be at all idomatic to write five-26 or five-oh-6
- allowing that pattern clashes with time range parsing, e.g.
  "9-10 am" should parse as a time range, not as "9:10 am"

Reviewed By: chessai

Differential Revision: D27848428

fbshipit-source-id: dfe8b98cb38119a16db2a19db47fd3128783e617
2021-04-22 11:47:28 -07:00
Steven Troxler
23ec021b07 Duration/RU: For non-int times, use the coarsest grain
Summary:
This commit fixes #111, which was an open issue that any non-integer
multiple of any unit of time was being converted to seconds.

My solution is to write a recursive function `Duration.Helpers.inCoarsestGrain`
which, given a grain `g` and double value `v` finds the coarses grain `g'` such that
`v * g` - rounded to the nearest seconds - has integral units.

We call this function only in the case of non-integer multiples, and we start our
search from the given grain because nothing coarser would make sense. The code could
actually be slightly more efficient if we started at the next-smallest grain, but
in the interest of clarity I think this is probably better.

Reviewed By: chessai

Differential Revision: D27891439

fbshipit-source-id: b048310963eb71337fd91ab4ef3c840134a76e73
2021-04-21 13:32:38 -07:00
Steven Troxler
f73277c2b0 Duration/EN: fix lint errors
Summary:
Minor changes to silence most linter errors
- remove redundant import
- delete some redundant brackets and tweak bracket locations
- switch . to $ to avoid excessive-point-free-style warnings

Also linted Duration/Types.hs

Reviewed By: chessai

Differential Revision: D27891440

fbshipit-source-id: d84287edafe328aeddd78b781618ec5c41944bd8
2021-04-21 13:32:37 -07:00
Steven Troxler
35532b0b7c Time/EN: Tighten up handling of split times like "five ten"
Summary:
While debugging an attempt to extend our handling of spelled-out
times, I realized that we are being too aggressive in our parsing of
times like "five ten", because we'll parse "five nine" as possibly
meaning "5:09", which isn't something an English speaker would say
(or rather if they did, it's more likely they mean "five (to) six"
or something similar.

Reviewed By: chessai

Differential Revision: D27848429

fbshipit-source-id: 34d783332fd60359ad9b6e7862367453bc93a1d1
2021-04-20 05:31:53 -07:00
Steven Troxler
a250e60cbb Silence many lint errors on Time/{Helpers,Types}.hs
Summary:
This commit gets rid of all the easy-to-fix lint warnings on time helper modules:
- replacing unnecessary `.` with `$`
- Flipping a lambda in a map to an infix operation
- Use `ts` for a list of times, not `series` which produces a pretty confusing naming collision

There are still quite a lot of lint errors related to name masking, which would be challenging to fix without us coming to an agreement about naming conventions.

But at least in my editor, name-masking errors are a lot less visually noisy than other errors (they only highlight the one name) so I don't mind them as much when skimming the code.

Reviewed By: chessai

Differential Revision: D27842198

fbshipit-source-id: 9091e5349657243b61d7ee169d0d06dd2122ac17
2021-04-19 18:16:55 -07:00
Splinter Suidman
933c287854 NL: Fix spelling of ‘achttien’ (18) (#602)
Summary:
The Dutch numeral and ordinal rules contained a spelling mistake: [‘achttien’](https://en.wiktionary.org/wiki/achttien) (18) was spelt as ‘achtien’ (note the single *t*).

This PR fixes this spelling mistake everywhere in the code base.

Pull Request resolved: https://github.com/facebook/duckling/pull/602

Reviewed By: patapizza

Differential Revision: D27859001

Pulled By: chessai

fbshipit-source-id: 8da0d8b099d49cf6207d4066cee1fc7da68a418e
2021-04-19 18:01:33 -07:00
Steven Troxler
586522b649 Numeral: Silence point-free lint errors in Numeral/Helpers.hs
Summary:
While looking at bugfixes for some ES and IT numeral parsing, I was
looking at the Helpers.hs module and figured I'd silence some lint
errors. There are still some name-masking lint issues, but all others
have been fixed.

Reviewed By: chessai

Differential Revision: D27854164

fbshipit-source-id: 5be8d924b033a55608c455074df1c80c8c0019be
2021-04-19 16:47:10 -07:00
jkachmar
e7f320e0c9 Bumps tasty upper bound (< 1.5) (#605)
Summary:
Closes https://github.com/facebook/duckling/issues/600

 ---

I saw the latest 0.2.0.0 release announcement and decided to try building the project locally.

This compiles successfully with `tasty-1.4.1` and `cabal-install` (cf. the  snippet below if you want to see the full set of packages I compiled/tested with).

<details>
  <summary> cabal.project.freeze </summary>

```
active-repositories: hackage.haskell.org:merge
constraints: any.HUnit ==1.6.2.0,
             any.aeson ==1.5.6.0,
             aeson -bytestring-builder -cffi -developer -fast,
             any.ansi-terminal ==0.11,
             ansi-terminal -example,
             any.ansi-wl-pprint ==0.6.9,
             ansi-wl-pprint -example,
             any.array ==0.5.4.0,
             any.assoc ==1.0.2,
             any.attoparsec ==0.13.2.5,
             attoparsec -developer,
             any.base ==4.14.1.0,
             any.base-compat ==0.11.2,
             any.base-compat-batteries ==0.11.2,
             any.base-orphans ==0.8.4,
             any.bifunctors ==5.5.10,
             bifunctors +semigroups +tagged,
             any.binary ==0.8.8.0,
             any.blaze-builder ==0.4.2.1,
             any.bytestring ==0.10.12.0,
             any.bytestring-builder ==0.10.8.2.0,
             bytestring-builder +bytestring_has_builder,
             any.call-stack ==0.3.0,
             any.case-insensitive ==1.2.1.0,
             any.clock ==0.8.2,
             clock -llvm,
             any.colour ==2.3.5,
             any.comonad ==5.0.8,
             comonad +containers +distributive +indexed-traversable,
             any.constraints ==0.12,
             any.constraints-extras ==0.3.1.0,
             constraints-extras +build-readme,
             any.containers ==0.6.2.1,
             any.data-fix ==0.3.1,
             any.deepseq ==1.4.4.0,
             any.dependent-sum ==0.7.1.0,
             any.directory ==1.3.6.0,
             any.distributive ==0.6.2.1,
             distributive +semigroups +tagged,
             any.dlist ==1.0,
             dlist -werror,
             any.extensible-exceptions ==0.1.1.4,
             any.extra ==1.7.9,
             any.filepath ==1.4.2.1,
             any.generic-deriving ==1.14,
             generic-deriving +base-4-9,
             any.ghc-boot-th ==8.10.4,
             any.ghc-prim ==0.6.1,
             any.happy ==1.20.0,
             any.hashable ==1.3.1.0,
             hashable +integer-gmp,
             any.haskell-src-exts ==1.23.1,
             any.hsc2hs ==0.68.7,
             hsc2hs -in-ghc-tree,
             any.indexed-traversable ==0.1.1,
             any.integer-gmp ==1.0.3.0,
             any.integer-logarithms ==1.0.3.1,
             integer-logarithms -check-bounds +integer-gmp,
             any.io-streams ==1.5.2.0,
             io-streams +network -nointeractivetests +zlib,
             any.io-streams-haproxy ==1.0.1.0,
             any.lifted-base ==0.2.3.12,
             any.monad-control ==1.0.2.3,
             any.mtl ==2.2.2,
             any.network ==3.1.2.1,
             network -devel,
             any.network-uri ==2.6.4.1,
             any.old-locale ==1.0.0.7,
             any.optparse-applicative ==0.16.1.0,
             optparse-applicative +process,
             any.parsec ==3.1.14.0,
             any.pretty ==1.1.3.6,
             any.primitive ==0.7.1.0,
             any.process ==1.6.9.0,
             any.random ==1.2.0,
             any.readable ==0.3.1,
             any.regex-base ==0.94.0.1,
             any.regex-pcre ==0.95.0.0,
             any.regex-posix ==0.96.0.0,
             regex-posix -_regex-posix-clib,
             any.rts ==1.0,
             any.scientific ==0.3.6.2,
             scientific -bytestring-builder -integer-simple,
             any.semigroups ==0.19.1,
             semigroups +binary +bytestring -bytestring-builder +containers +deepseq +hashable +tagged +template-haskell +text +transformers +unordered-containers,
             any.snap-core ==1.0.4.2,
             snap-core -debug +network-uri -portable,
             any.snap-server ==1.1.2.0,
             snap-server -build-pong -build-testserver -debug -openssl -portable,
             any.some ==1.0.2,
             some +newtype-unsafe,
             any.splitmix ==0.1.0.3,
             splitmix -optimised-mixer,
             any.stm ==2.5.0.0,
             any.strict ==0.4.0.1,
             strict +assoc,
             any.tagged ==0.8.6.1,
             tagged +deepseq +transformers,
             any.tasty ==1.4.1,
             tasty +clock +unix,
             any.tasty-hunit ==0.10.0.3,
             any.template-haskell ==2.16.0.0,
             any.text ==1.2.4.1,
             any.text-show ==3.9,
             text-show +base-4-9 +new-functor-classes +template-haskell-2-11,
             any.th-abstraction ==0.4.2.0,
             any.th-compat ==0.1.2,
             any.th-lift ==0.8.2,
             any.these ==1.1.1.1,
             these +assoc,
             any.time ==1.9.3,
             any.time-compat ==1.9.5,
             time-compat -old-locale,
             any.timezone-olson ==0.2.0,
             any.timezone-series ==0.1.9,
             any.transformers ==0.5.6.2,
             any.transformers-base ==0.4.5.2,
             transformers-base +orphaninstances,
             any.transformers-compat ==0.6.6,
             transformers-compat -five +five-three -four +generic-deriving +mtl -three -two,
             any.type-equality ==1,
             any.unbounded-delays ==0.1.1.1,
             any.unix ==2.7.2.2,
             any.unix-compat ==0.5.3,
             unix-compat -old-time,
             any.unordered-containers ==0.2.13.0,
             unordered-containers -debug,
             any.uuid-types ==1.0.4,
             any.vector ==0.12.3.0,
             vector +boundschecks -internalchecks -unsafechecks -wall,
             any.wcwidth ==0.0.2,
             wcwidth -cli +split-base,
             any.zlib ==0.6.2.3,
             any.zlib-bindings ==0.1.1.5
index-state: hackage.haskell.org 2021-04-18T19:08:29Z
```

</details>

The test suite fails with the following error:

```
    Numeral Tests
      AF Tests
        Corpus Tests:              FAIL
          tests/Duckling/Testing/Asserts.hs:90:
          empty result on "agt"
```

...but from what I can tell by the last few CI runs some corpus test errors are not unexpected so I figure this _probably_ isn't a regression.

 ---

I avoided messing with the Stackage snapshot since that seemed out-of-scope, but I could rework this PR (or open another) to update it to the latest LTS resolver and/or add a Stackage Nightly resolver as well.

Pull Request resolved: https://github.com/facebook/duckling/pull/605

Reviewed By: girifb

Differential Revision: D27858969

Pulled By: chessai

fbshipit-source-id: 3f60fd28fe8eeb903de40c696c59ae10eedf12e4
2021-04-19 16:02:32 -07:00
chessai
8ce33d81f5 Update CHANGELOG (#610)
Summary:
Recent changes were allowed in without changelog entries (my fault).
This adds entries for those changes.

Pull Request resolved: https://github.com/facebook/duckling/pull/610

Reviewed By: haoxuany

Differential Revision: D27867893

Pulled By: chessai

fbshipit-source-id: 6e3d9dce496f0f9344dcb65c5e2dd3f1f1c380eb
2021-04-19 16:02:32 -07:00
Steven Troxler
9bd4c9b7fb Time/EN: Allow latent match for <part-of-day> <latent-time-of-day>
Summary:
This fixes #592 in a very conservative way: the reason why `ruleIntersect` does
not detect "tonight 815" and "tonight eight fifteen" as it does "tonight 8:15"
is because it explicitly forbids the second part of the intersection from being
latent, unless it is a year.

I don't think it's a good idea to remove the restriction on latent inputs in
`ruleIntersect`, so instead I just made a new rule specifically for the
intersection of `<part-of-day> <time-of-day>`.

It also seems to me that there's a lot of room for this to be too aggressive,
for example if I say "tonight 500 people will laugh" the "tonight" and "500"
aren't really linked. So, I set the rule to be latent; this may be too conservative
to be useful though (do client libraries usually allow latent results?).

Reviewed By: chessai

Differential Revision: D27842596

fbshipit-source-id: 36ac59e31c632d4864241bce291147a46d52f780
2021-04-19 13:05:50 -07:00
evjava
f1cb3bc87c Russian(RU) duration improvements (#375)
Summary:
- dimunitives for minutes and hours
- quarters of an hour
- added 'сутки' (24-hour period)
Pull Request resolved: https://github.com/facebook/duckling/pull/375

Reviewed By: stroxler

Differential Revision: D20332233

Pulled By: chessai

fbshipit-source-id: 479858e6c5de856a6965b6193c481e654a6e04fb
2021-04-16 14:31:41 -07:00
chessai
d712bee78b initialise changelog (#597)
Summary:
resolves https://github.com/facebook/duckling/issues/455

Pull Request resolved: https://github.com/facebook/duckling/pull/597

Reviewed By: girifb

Differential Revision: D27806129

Pulled By: chessai

fbshipit-source-id: 4bca273fef5df0848c2b92d3ac753b66cedfcdcb
2021-04-16 10:02:28 -07:00
chessai
3e4fe974a3 update ci (#594)
Summary:
- Update GHC 8.10.2 to 8.10.3
- Add GHC 9.0.1
- Make stack CI as extensive as cabal CI
- update tested-with
- remove cabal CI, keep stack only

Pull Request resolved: https://github.com/facebook/duckling/pull/594

Reviewed By: girifb

Differential Revision: D27710921

Pulled By: chessai

fbshipit-source-id: 098bcbb33c7dc7dfac4e2e46ca9ea07083b47b59
2021-04-12 18:32:23 -07:00
chessai
e6e000fb62 v0.1.6.1 -> v0.2.0.0 (#593)
Summary:
Necessary major version bump as per PVP: https://pvp.haskell.org/

Pull Request resolved: https://github.com/facebook/duckling/pull/593

Reviewed By: girifb

Differential Revision: D27710929

Pulled By: chessai

fbshipit-source-id: 16fb24e108ab6696d31c94573e79644248bf00e2
2021-04-12 14:17:18 -07:00
leandro.guisandez@pgconocimiento.com
f3e128a07b Add Ordinal dimension to CA (Catalan) locale
Summary: Adds Ordinal rules to Catalan language

Reviewed By: patapizza

Differential Revision: D27681617

Pulled By: chessai

fbshipit-source-id: 145a1117eeff10839484f34a87e9bd685382d42e
2021-04-09 13:05:19 -07:00
leandro.guisandez@pgconocimiento.com
7907812184 Initialise Catalan language with Numeral
Summary: Adds Catalan language and Numeral rules for it

Reviewed By: haoxuany

Differential Revision: D26518604

Pulled By: chessai

fbshipit-source-id: e6b4b0ceb9b7931d086c732dd03fb5cbbe062d5b
2021-04-08 14:47:02 -07:00
chessai
9babaee20a add missing copyright headers (#591)
Summary: Pull Request resolved: https://github.com/facebook/duckling/pull/591

Reviewed By: patapizza

Differential Revision: D27623732

Pulled By: chessai

fbshipit-source-id: e38a64d04d004ea80fabeb5efbc635b00e2802df
2021-04-08 10:46:31 -07:00
Amr Keleg
8a8f557002 Add more variants of egp to EN and AR AmountOfMoney dimension (#590)
Summary:
These are popular variants/abbreviations of Egyptian pounds.
All these forms are documented on wikipedia (https://en.wikipedia.org/wiki/Egyptian_pound)

Pull Request resolved: https://github.com/facebook/duckling/pull/590

Reviewed By: haoxuany

Differential Revision: D27598249

Pulled By: chessai

fbshipit-source-id: 42ae9115b1def48c58e50a6deb624c3407c029f3
2021-04-07 12:31:41 -07:00
Mustafa ALP
3157d2e553 Time Dimension for TR locale (#584)
Summary:
Added time dimension for Turkish language

Pull Request resolved: https://github.com/facebook/duckling/pull/584

Differential Revision: D27235743

Pulled By: chessai

fbshipit-source-id: 7419ff7373d942530f0eb35939acb9970b918672
2021-04-06 10:32:18 -07:00
chessai
4c4d5ca725 bump dependencies (#588)
Summary: Pull Request resolved: https://github.com/facebook/duckling/pull/588

Reviewed By: girifb

Differential Revision: D27435008

Pulled By: chessai

fbshipit-source-id: f0b0a42752cfebcf290cbc6c6d194ba09724670f
2021-03-30 12:47:10 -07:00
Mustafa ALP
5385346e69 Update README.md (#585)
Summary:
Convert `This` to `Seal` in order to make this example working.

Pull Request resolved: https://github.com/facebook/duckling/pull/585

Reviewed By: girifb

Differential Revision: D27235685

Pulled By: chessai

fbshipit-source-id: 71a712a622b5d9d10f7842276a2b8f60f962477e
2021-03-26 14:33:53 -07:00