kanji.js
Home
Documentations
Downloads
Download v1.6.2
漢字 object
Kanji character object
// Kanji character object example
{
  freq: 1,
  grade: 1,
  jlpt: 4,
  kunyomi: ['', '-び', '-か'],
  literal: '',
  meanings: ['day', 'sun', 'Japan', 'counter for days'],
  onyomi: ['ニチ', 'ジツ'],
  stroke_count: 4
}
Methods
Kanji class methods
Static Method: getDetails(character)
Return type: object

Gets the details of the 漢字 character and returns it. If the character was not found on the dictionary, this returns null.

Static Method: search(options = {})
Return type: object[]

Searches the entire dictionary file for words that matches the options.

  // Available options
  {
    jlpt: 1,
    grade: 1,
    romaji: 'hi',
    meaning: 'counter for days',
    sort: true // Enable sorting by best matches; default: true
  }

  // You can also search jlpt and/or grade by specifying `min` and `max`
  {
    jlpt: {
      min: 1,
      max: 2
    },
    grade: {
      min: 1,
      max: 2
    },
    romaji: 'hi',
    meaning: 'counter for days',
    sort: true
  }
Static Method: random()
Return type: object

Returns a random 漢字 character.