1.1.0 • Published 6 years ago
japanese-characters v1.1.0
japanese-characters
Analyze strings to detect if they contain Japanese characters.
Detects Hiragana and Katakana characters.
Installation
npm install japanese-charactersUsage
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 giveninputStringcontains Japanese characters
const japaneseCharacters = require('japanese-characters')
console.log(japaneseCharacters.presentIn('ブートキャンプ')
// true
console.log(japaneseCharacters.presentIn('some English string')
// falseOrdered by Frequency
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.
Tests
npm install
npm testDependencies
None
Dev Dependencies
License
MIT