Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kjirou/romaji-fuzzy-search
Generates a regular expression for "Romaji Fuzzy Search"
https://github.com/kjirou/romaji-fuzzy-search
npm-package romaji
Last synced: 13 days ago
JSON representation
Generates a regular expression for "Romaji Fuzzy Search"
- Host: GitHub
- URL: https://github.com/kjirou/romaji-fuzzy-search
- Owner: kjirou
- License: mit
- Created: 2021-07-24T01:18:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-06T01:18:15.000Z (over 2 years ago)
- Last Synced: 2024-12-07T16:37:43.225Z (20 days ago)
- Topics: npm-package, romaji
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/romaji-fuzzy-search
- Size: 97.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# romaji-fuzzy-search
![Run tests](https://github.com/kjirou/romaji-fuzzy-search/workflows/Run%20tests/badge.svg)
This module generates a regular expression for "Romaji Fuzzy Search".
## :thinking: "Romaji Fuzzy Search"?
It's an 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
```js
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.
```