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: over 1 year 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 (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-25T15:26:14.000Z (almost 5 years ago)
- Last Synced: 2024-10-12T06:15:05.506Z (almost 2 years 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.




[](http://www.typescriptlang.org/)


## π¦ 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.hangulSearch
var search = createSearch([
'λ‘―λ°μλ€λ§',
'μ νλΈ',
'νλ‘κ²μ΄λ¨Έ',
'κ°λ',
'λκ°'
])
var result = search('μγ΄')
// result: ['λ‘―λ°μλ€λ§', 'νλ‘κ²μ΄λ¨Έ', 'κ°λ', 'λκ°']
var resultExact = search('μγ΄', { exact: true })
// result: ['λ‘―λ°μλ€λ§']
var resultExact = search('λκ°', { exact: true, order: true })
// result: ['λκ°']
```
## π‘ License
> MIT Licensed.