Skip to content

hmmhmmhm/hangul-search-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‡°πŸ‡· 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 GitHub License Jest Coverage Gzip Size TypeScript NPM Version jsDelivr


πŸ“¦ Usage (ES5+)

npm i hangul-search-js
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)

<script src="https://cdn.jsdelivr.net/npm/hangul-search-js/export/hangul-search.js"></script>
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.

About

πŸ‡°πŸ‡· Simple Korean text search module

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published