Code Monkey home page Code Monkey logo

pinyin-rest's Introduction

Pinyin REST

dependency status dev dependency status MIT-licensed chat on gitter

Install

npm install pinyin-rest

GET /pinyin/...

Examples

GET: https://api.pinyin.pepe.asia/pinyin/我的猫喜欢喝牛奶
=> {
     "text": "wǒ de māo xǐhuan hē niúnǎi",
     "data": ["", ["de",  "",  "",  ""], " māo xǐhuan ", ["", ""], " niúnǎi"]
   }
GET: https://api.pinyin.pepe.asia/pinyin/wo3 xi3huan1 he1 cha2
=> {
     "text": "wǒ xǐhuān hē chá",
     "data": "wǒ xǐhuān hē chá"
   }
GET: https://api.pinyin.pepe.asia/pinyin/woxihuanhecha?split=true
=> {
     "text": "wo xi huan he cha",
     "data": ["wo", "xi", "huan", "he", "cha"]
   }

GET /definition/...

Example

GET: https://api.pinyin.pepe.asia/definition/的
=> {
     "de5": [
       "of",
       "~'s (possessive particle)",
       "(used after an attribute)",
       "(used to form a nominal expression)",
       "(used at the end of a declarative sentence for emphasis)"
     ],
     "di1": [
       "see 的士[di1 shi4]"
     ],
     "di2": [
       "really and truly"
     ],
     "di4": [
       "aim",
       "clear"
     ]
   }

GET /hanzi/...

Example

GET: https://api.pinyin.pepe.asia/hanzi/苹果
=> {
     "traditional": "蘋果",
     "simplified": "苹果",
     "data": {
       "ping2 guo3": {
         "mandarin": "píng guǒ",
         "definitions": [
           "apple"
         ],
         "classifiers": {
           "ge4": {
             "traditional": "",
             "simplified": "",
             "mandarin": "",
             "definition": "classifier for people or objects in general"
           },
           "ke1": {
             "traditional": "",
             "simplified": "",
             "mandarin": "",
             "definition": "classifier for small spheres, pearls, corn grains, teeth, hearts, satellites etc"
           }
         }
       }
     }
   }

Related

Contributing

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

pinyin-rest's People

Contributors

pepebecker avatar

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.