duckling-client
v0.1.0
Published
A client for [duckling](https://github.com/facebook/duckling).
Downloads
1
Readme
duckling-client
A client for duckling.
Installation
# using npm
npm i duckling-client
# using yarn
yarn add duckling-client
# using pnpm
pnpm i duckling-client
Usage
import { DucklingClient } from "duckling-client";
const client = new DucklingClient({
endpoint: "http://0.0.0.0:8000",
locale: "nl_NL",
dims: ["volume"],
});
const result = await client.parse("3ml ghb");
This gives the result
variable a value that looks something like following:
[
{
"body": "3ml",
"start": 1,
"value": {
"value": 3,
"type": "value",
"unit": "millilitre"
},
"end": 4,
"dim": "volume",
"latent": false
}
]