Analyze strings to detect if they contain Japanese characters.
Detects Hiragana and Katakana characters.
npm install japanese-characters
The module exports an object with three values:
hiragana, an array of all the Hiragana characterskatakana, an array of all the Katakana characterspresentIn(inputString), a function that returns a Boolean indicating whether the given inputString contains Japanese charactersconst japaneseCharacters = require('japanese-characters')
console.log(japaneseCharacters.presentIn('ブートキャンプ')
// true
console.log(japaneseCharacters.presentIn('some English string')
// false
To make searching more efficient, the characters are sorted by frequency of use. This order was determined by counting the number of each characters in the Japanese Wikipedia Corpus.
npm install
npm test
None
MIT