1.0.10 • Published 3 years ago

longdo-api v1.0.10

Weekly downloads
11
License
MIT
Repository
github
Last release
3 years ago

longdo-api

A simple unofficial Node.js API for straightforward interfacing with Longdo's dictionary API.

Installation

Using NPM:

$ npm install longdo-api

Using Yarn:

$ yarn add longdo-api

Usage

async search(query, cleanup=true)

Queries the Longdo API and returns the result (see format below)

Parameters:

  • query: query to search (string)
  • cleanup: whether to clean up data (string trim, etc.)

Returns: Promise<Record<string, string>>

Example code

const longdo = require('longdo-api');

longdo.search('fandango').then((result) => {
    console.log(result);
});

Response example

{
    "NECTEC Lexitron Dictionary EN-TH": [
        ["fandango", "[N] การเต้นระบำสเปนแบบสามจังหวะ, See also: ดนตรีสามจังหวะสำหรับเต้นระบำสเปน"]
    ],
    "ตัวอย่างประโยคจาก Open Subtitles ** ระวัง คำแปลอาจมีข้อผิดพลาด **": [
        ["# Scaramouch, scaramouch Will you do the fandango #", "# เจ้าคนชั่ว, เจ้าคนชั่ว เจ้าเต้นรำได้มั้ย?"],
        [
            "We must do something before they fandango themselves into oblivion!",
            "เราต้องทำอะไรซักอย่าง ก่อนที่พวกเขาจะเต้นจนหายเข้าไปในป่า"
        ],
        ["- Hey. - Christ Fandango!", "เฮ้ คริสตร์ แฟนเดโก"]
    ],
    "CMU Pronouncing Dictionary": [["FANDANGO", "F AE0 N D AE1 NG G OW2"]],
    "Oxford Advanced Learners Dictionary": [
        ["fandango", "(n) fˌændˈæŋgou"],
        ["fandangos", "(n) fˌændˈæŋgouz"]
    ],
    "EDICT JP-EN Dictionary": [["ファンダンゴ", "[, fandango] (n) fandango (spa"]]
}

License

MIT

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago