Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curl ignores dim_filter and reference_time #166

Closed
AdrianSzymczak opened this issue Mar 17, 2018 · 1 comment
Closed

curl ignores dim_filter and reference_time #166

AdrianSzymczak opened this issue Mar 17, 2018 · 1 comment

Comments

@AdrianSzymczak
Copy link

AdrianSzymczak commented Mar 17, 2018

Could you please help with duckling part which seems to work unproperly:

parseHandler :: HashMap Text TimeZoneSeries -> Snap ()
parseHandler tzs = do
  modifyResponse $ setHeader "Content-Type" "application/json"
  t <- getPostParam "text"
  l <- getPostParam "lang"
  ds <- getPostParam "dims"
  tz <- getPostParam "tz"
  loc <- getPostParam "locale"
  ref <- getPostParam "reftime"

Because extending curl (from the example)
curl -XPOST http://0.0.0.0:8000/parse --data 'locale=en_GB&text=tomorrow at eight'
with dim, dims, dim_filter, dim-filter etc. seems to have no effect.

Could you please enrich example curl command and if need be fix POST parsing, so that reference_time and dim_filter parameters would work?
When using old duckling model (python wrapper over jvm) it was possible to specify them without any issues, so it seems to be example server issue

@patapizza
Copy link
Contributor

Hi @AdrianSzymczak,

Here's an example on how to query for both dims and reftime:

curl -XPOST http://0.0.0.0:8000/parse --data 'locale=en_XX&text=right now&dims=["time"]&reftime=1430604300000'
[{"body":"right now","start":0,"value":{"values":[{"value":"2015-05-02T15:05:00.000-07:00","grain":"second","type":"value"}],"value":"2015-05-02T15:05:00.000-07:00","grain":"second","type":"value"},"end":9,"dim":"time"}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants