duckling-client
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

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
    }
]

Dependents (0)

Package Sidebar

Install

npm i duckling-client

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

325 kB

Total Files

28

Last publish

Collaborators

  • rik.hoffbauer