Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hmmhmmhm/hangul-search-js
π°π· Simple Korean text search module
https://github.com/hmmhmmhm/hangul-search-js
korea korean korean-language korean-letters korean-nlp korean-text-processing
Last synced: about 2 months ago
JSON representation
π°π· Simple Korean text search module
- Host: GitHub
- URL: https://github.com/hmmhmmhm/hangul-search-js
- Owner: hmmhmmhm
- License: mit
- Created: 2021-09-25T12:39:18.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-25T15:26:14.000Z (over 3 years ago)
- Last Synced: 2024-10-12T06:15:05.506Z (3 months ago)
- Topics: korea, korean, korean-language, korean-letters, korean-nlp, korean-text-processing
- Language: TypeScript
- Homepage:
- Size: 1.49 MB
- Stars: 25
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π°π· Hangul Search Js
> It allows you to search for simple Korean characters in the most consistent order regardless of the character assembly order.
![Github Workflow](https://github.com/hmmhmmhm/hangul-search-js/actions/workflows/test.yml/badge.svg)
![GitHub License](https://img.shields.io/github/license/hmmhmmhm/hangul-search-js)
![Jest Coverage](https://raw.githubusercontent.com/hmmhmmhm/hangul-search-js/main/badges/badge-lines.svg)
![Gzip Size](https://img.badgesize.io//hmmhmmhm/hangul-search-js/main/export/hangul-search.js.svg?compression=gzip)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)
![NPM Version](https://img.shields.io/npm/v/hangul-search-js.svg?label=version)
![jsDelivr](https://badgen.net/jsdelivr/v/npm/hangul-search-js)
## π¦ Usage (ES5+)
```bash
npm i hangul-search-js
``````ts
import { createSearch } from 'hangul-search-js'const search = createSearch([
'λ‘―λ°μλ€λ§',
'μ νλΈ',
'νλ‘κ²μ΄λ¨Έ',
'κ°λ',
'λκ°'
])const result = search('μγ΄')
// result: ['λ‘―λ°μλ€λ§', 'νλ‘κ²μ΄λ¨Έ', 'κ°λ', 'λκ°']const resultExact = search('μγ΄', { exact: true })
// result: ['λ‘―λ°μλ€λ§']const resultExact = search('λκ°', { exact: true, order: true })
// result: ['λκ°']
```
## π¦ Usage (CDN)
```html
```
```js
var createSearch = window.hangulSearchvar search = createSearch([
'λ‘―λ°μλ€λ§',
'μ νλΈ',
'νλ‘κ²μ΄λ¨Έ',
'κ°λ',
'λκ°'
])var result = search('μγ΄')
// result: ['λ‘―λ°μλ€λ§', 'νλ‘κ²μ΄λ¨Έ', 'κ°λ', 'λκ°']var resultExact = search('μγ΄', { exact: true })
// result: ['λ‘―λ°μλ€λ§']var resultExact = search('λκ°', { exact: true, order: true })
// result: ['λκ°']
```
## π‘ License
> MIT Licensed.