Giter VIP home page Giter VIP logo

mdbg's Introduction

MDBG

npm version Travis Build Status dependency status dev dependency status ISC-licensed

Install

npm install mdbg

Usage

const mdbg = require('mdbg')

mdbg.get('苹果') // mdbg.getByHanzi('苹果')
.then(console.log)
// {
//   "traditional": "蘋果",
//   "simplified": "苹果",
//   "definitions": {
//     ping2 guo3": {
//       "pinyin": "píng guǒ",
//       "zhuyin": "ㄆㄧㄥˊㄍㄨㄛˇ",
//       "translations": [
//         "apple"
//       ],
//       "classifiers": {
//         "ge4": {
//           "traditional": "個",
//           "simplified": "个",
//           "pinyin": "gè"
//         },
//         "ke1": {
//           "traditional": "顆",
//           "simplified": "颗",
//           "pinyin": "kē"
//         }
//       }
//     }
//   }
// }

mdbg.get('吗') // mdbg.getByHanzi('吗')
.then(console.log)
// {
//   "traditional": "嗎",
//   "simplified": "吗",
//   "definitions": {
//     "ma3": {
//       "pinyin": "mǎ",
//       "zhuyin": "ㄇㄚˇ",
//       "translations": [
//         "see 嗎啡|吗啡, morphine"
//       ]
//     },
//     "ma5": {
//       "pinyin": "ma",
//       "zhuyin": "ㄇㄚ˙",
//       "translations": [
//         "(question particle for \"yes-no\" questions)"
//       ]
//     }
//   }
// }

mdbg.get('wo3') // mdbg.getByPinyin('wo3')
.then(console.log)
// [
//   {
//     "traditional": "我",
//     "simplified": "我",
//     "definitions": {
//       "wo3": {
//         "pinyin": "wǒ",
//         "zhuyin": "ㄨㄛˇ",
//         "translations": [
//           "I",
//           "me",
//           "my"
//         ]
//       }
//     }
//   },
//   {
//     "traditional": "婐",
//     "simplified": "婐",
//     "definitions": {
//       "wo3": {
//         "pinyin": "wǒ",
//         "zhuyin": "ㄨㄛˇ",
//         "translations": [
//           "maid"
//         ]
//       }
//     }
//   }
// ]

mdbg.get('ㄒㄧˇㄏㄨㄢ˙') // mdbg.getByZhuyin('ㄒㄧˇㄏㄨㄢ˙')
// .then(console.log)
// [
//   {
//     "traditional": "喜歡",
//     "simplified": "喜欢",
//     "definitions": {
//       "xi3 huan5": {
//         "pinyin": "xǐ huan",
//         "zhuyin": "ㄒㄧˇㄏㄨㄢ˙",
//         "translations": [
//           "to like",
//           "to be fond of"
//         ]
//       }
//     }
//   }
// ]

mdbg.getIndexByPinyin('shui3')
.then(console.log)
// [ "水", "氵", "氺" ]

mdbg.getIndexByZhuyin('ㄍㄨㄛˇ')
.then(console.log)
// [ "惈", "槨", "猓", "粿", "菓", "蜾", "裹", "輠", "餜" ]

Related

Contributing

If you have a question, found a bug or want to propose a feature, have a look at the issues page.

mdbg's People

Contributors

greenkeeper[bot] avatar hannesholste avatar pepebecker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

hannesholste

mdbg's Issues

Unable to npm install package

I am having trouble install mdbg due to errors installing leveldown.

npm ERR! [email protected] install: prebuild-install || node-gyp rebuild``

I have quite a bit of log data, and happy to share, but could this be fixed by upgrading the level/sublevel dependencies and releasing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.