romaji-fuzzy-search
v1.1.0
Published
Generates a regular expression for "Romaji Fuzzy Search"
Downloads
3
Readme
romaji-fuzzy-search
This module generates a regular expression for "Romaji Fuzzy Search".
:thinking: "Romaji Fuzzy Search"?
It's a original concept.
Allows you to search Japanese Hiragana and Katakana from a query consisting of alphabets.
:rocket: Installation
npm install romaji-fuzzy-search
:cat: Usage
const {convertToRegExp} = require('romaji-fuzzy-search')
const query = 'kyayaak'
const regExp = convertToRegExp('kyayaak') // -> "(?:kya|きゃ|キャ)(?:ya|や|ヤ)(?:a|あ|ア)k"
const matcher = new RegExp(regExp, 'i') // I think it's better to specify the "i" option.