Git Product home page Git Product logo

kanji.js's Introduction

Kanji.js

Node.js CI npm GitHub

漢字 search/lookup library for Node.js and browsers. It uses the KANJIDIC dictionary file to search/lookup for the characters. The dictionary file is included so that it will work with browsers. The size of the distributed file is about ~2MB.

Visit kanji.js.org to learn more about the library. You can also explore the examples directory for examples on how to use the library.

The website is also open sourced and can be viewed at gh-pages branch.

Features

  • Easy to use
  • Fuzzy search function

Installation

You can download the ready-to-use script at GitHub releases. You can also install this package by using npm:

npm install --save kanji.js@latest

If you are using browser, you can just install the library through a CDN:

<script src="https://cdn.jsdelivr.net/npm/kanji.js@latest/dist/kanji.min.js">

Usage

Kanji.dump() // Returns an array of all the characters.

Kanji.getDetails('気')
//  {
//    freq: 113,
//    grade: 1,
//    jlpt: 4,
//    kunyomi: ["いき"],
//    literal: "気",
//    meanings: (5) ["spirit", "mind", "air", "atmosphere", "mood"],
//    onyomi: (2) ["キ", "ケ"],
//    stroke_count: 6
//  }

Kanji.search({
  grade: 1,
  meaning: 'counter for days'
})
//  [{
//    freq: 1,
//    grade: 1,
//    jlpt: 4,
//    kunyomi: (3) ["ひ", "-び", "-か"],
//    literal: "日",
//    meanings: (4) ["day", "sun", "Japan", "counter for days"],
//    onyomi: (2) ["ニチ", "ジツ"],
//    stroke_count: 4
//  }]

If you want a detailed documentations, please visit the documentations page at kanji.js.org.

Support

If you had found a bug or any unexpected behavior, you can submit an issue through GitHub issues. If you wanted to contribute to this repository, please refer to CONTRIBUTING.md.

You can also show your support by becoming a patron!

Patreon

kanji.js's People

Contributors

dependabot[bot] avatar dependabot-preview[bot] avatar eidoriantan avatar

Stargazers

KAGSA 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.