@vntk/dictionary

1.0.0 • Public • Published

dictionary

Vietnamese Dictionary for Node

MIT License npm version downloads Travis

Installation

Using npm:

npm install @vntk/dictionary --save

API Usage

Properties

  • words - List of words in the dictionary
  • lower_words - List of word in lower case
  • definitions - List of word definitions

Method: .has(word:string)

Check a word is exists in dictionary

const dictionary = require('@vntk/dictionary')

dictionary.has('chào')
// true

Method: .lookup(word:string)

Lookup word definitons

const dictionary = require('@vntk/dictionary')

let senses = dictionary.lookup('chào')
console.log(senses)

// Output
[ { example: 'chào thầy giáo ~ con chào mẹ',
    sub_pos: 'Vt',
    definition: 'tỏ thái độ kính trọng hoặc quan tâm đối với ai bằng lời nói hay cử chỉ, khi gặp nhau hoặc khi từ biệt',
    pos: 'V' },
    { example: 'đứng nghiêm làm lễ chào cờ',
    sub_pos: 'Vu',
    definition: 'tỏ thái độ kính cẩn trước cái gì thiêng liêng, cao quý',
    pos: 'V' },
    { example: 'chào hàng ~ lời chào cao hơn mâm cỗ (tng)',
    sub_pos: 'Vu',
    definition: 'mời ăn uống hoặc mua hàng',
    pos: 'V' }]

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

Package Sidebar

Install

npm i @vntk/dictionary

Weekly Downloads

61

Version

1.0.0

License

MIT

Last publish

Collaborators

  • vunb