from hangulpy import HangulIndexindex = HangulIndex(["한국", "한글", "한굴", "가나다", "한글날"])results = index.search("한글")print([result.text for result in results[:2]]) # ["한글", "한글날"]print(results[0].score) # 1.0print(results[0].matched) # True
각 HangulSearchResult에는 원문 text, score, 입력 컬렉션의 index, 직접
일치 위치인 match_index가 들어 있습니다. matched는 초성·부분 음절 검색으로
직접 일치했는지 알려 줍니다.결과는 점수 내림차순으로 정렬하고, 같은 점수라면 정확 일치, 직접 일치, 퍼지
일치, 원본 순서를 차례로 적용합니다. limit은 0 이상의 정수여야 하며,
min_score는 0.0부터 1.0 사이여야 합니다.
HangulIndex는 후보의 자모 표현을 재사용하고 후보별 동적 계획법 한 번으로
최적 부분 문자열 점수를 구합니다. 다만 모든 후보를 비교하므로 아주 큰
컬렉션에서는 애플리케이션 도메인에 맞는 사전 필터를 함께 고려하세요.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"hangulpy","description":"A Python library for Korean language processing.","colors":{"primary":"#0f766e","light":"#14b8a6","dark":"#0f766e"},"appearance":{"default":"light"},"background":{"decoration":"gradient"},"navbar":{"links":[{"href":"https://github.com/gaon12/hangulpy","type":"github"},{"href":"https://pypi.org/project/hangulpy/","label":"PyPI"}]},"footer":{"socials":{"github":"https://github.com/gaon12/hangulpy"}},"search":{"prompt":"함수 이름이나 기능으로 검색"},"icons":{"library":"lucide"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"individual-6b14639d","hasAudioNarration":false,"actualSubdomain":"individual-6b14639d","customDomains":["hangulpy.uiharu.dev"],"gitSource":{"type":"github","owner":"gaon12","repo":"hangulpy","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6abb6b7a8c54b05533312d70","collectionId":"a7c14052-bb3d-4252-a307-4452a1421d6c","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6abb6b7a8c54b05533312d70"},"entitlements":{},"buildId":"6abb6b7a8c54b05533312d70","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"참고 자료","count":10},{"language":"default","tag":"변환과 정렬","count":9},{"language":"default","tag":"검색과 매칭","count":7},{"language":"default","tag":"분해와 조합","count":6},{"language":"default","tag":"한글 판별과 추출","count":5},{"language":"default","tag":"소개","count":4},{"language":"default","tag":"조사와 받침","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api/search/fuzzy-search","slug":"/api/search/fuzzy-search","pageMetadata":{"title":"한글 퍼지 검색","description":"자모 거리와 재사용 검색 인덱스로 오타와 초성 검색 처리","href":"/api/search/fuzzy-search"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"자모 거리와 재사용 검색 인덱스로 오타와 초성 검색 처리\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`완성형, NFD, 복합 모음과 겹받침을 기본 자모 단위로 통일해 문자열 사이의\n거리를 계산하거나 여러 후보를 반복 검색합니다.`}),`\n`,_jsx(Heading,{level:`2`,id:`거리와-유사도`,children:`거리와 유사도`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`hangul_distance(left: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, right: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},children:`->`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` float`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`hangul_similarity(left: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, right: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},children:`->`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` float`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`hangul_distance`}),`는 자모 단위 Levenshtein 거리를, `,_jsx(_components.code,{children:`hangul_similarity`}),`는 이를\n문자열 길이로 정규화한 `,_jsx(_components.code,{children:`0.0`}),`부터 `,_jsx(_components.code,{children:`1.0`}),` 사이의 점수를 반환합니다.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` hangulpy `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` hangul_distance, hangul_similarity`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(hangul_distance(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"한글\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"한국\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# 2.0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`round`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(hangul_similarity(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"한글\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"한국\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# 0.6667`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`반복-검색-인덱스`,children:`반복 검색 인덱스`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`HangulIndex(items: Iterable[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`HangulIndex.search(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` query: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` *`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` limit: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`int`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` min_score: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`float`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0.0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` list[HangulSearchResult]`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` hangulpy `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` HangulIndex`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`index `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` HangulIndex([`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"한국\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"한글\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"한굴\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"가나다\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"한글날\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`results `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` index.search(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"한글\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([result.text `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` result `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` results[:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]]) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# [\"한글\", \"한글날\"]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(results[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].score) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# 1.0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(results[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].matched) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# True`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`각 `,_jsx(_components.code,{children:`HangulSearchResult`}),`에는 원문 `,_jsx(_components.code,{children:`text`}),`, `,_jsx(_components.code,{children:`score`}),`, 입력 컬렉션의 `,_jsx(_components.code,{children:`index`}),`, 직접\n일치 위치인 `,_jsx(_components.code,{children:`match_index`}),`가 들어 있습니다. `,_jsx(_components.code,{children:`matched`}),`는 초성·부분 음절 검색으로\n직접 일치했는지 알려 줍니다.`]}),`\n`,_jsxs(_components.p,{children:[`결과는 점수 내림차순으로 정렬하고, 같은 점수라면 정확 일치, 직접 일치, 퍼지\n일치, 원본 순서를 차례로 적용합니다. `,_jsx(_components.code,{children:`limit`}),`은 0 이상의 정수여야 하며,\n`,_jsx(_components.code,{children:`min_score`}),`는 `,_jsx(_components.code,{children:`0.0`}),`부터 `,_jsx(_components.code,{children:`1.0`}),` 사이여야 합니다.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`HangulIndex`}),`는 후보의 자모 표현을 재사용하고 후보별 동적 계획법 한 번으로\n최적 부분 문자열 점수를 구합니다. 다만 모든 후보를 비교하므로 아주 큰\n컬렉션에서는 애플리케이션 도메인에 맞는 사전 필터를 함께 고려하세요.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"한글 퍼지 검색","description":"자모 거리와 재사용 검색 인덱스로 오타와 초성 검색 처리","href":"/api/search/fuzzy-search"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"거리와 유사도","slug":"거리와-유사도","depth":2,"children":[]},{"title":"반복 검색 인덱스","slug":"반복-검색-인덱스","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"individual-6b14639d","siteName":"hangulpy","title":"한글 퍼지 검색 - hangulpy","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-09T13:30:36.640Z","originalFileLocation":"api/search/fuzzy-search.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"자모 거리와 재사용 검색 인덱스로 오타와 초성 검색 처리\">\u003cmeta data-mint-head name=\"application-name\" content=\"hangulpy\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/individual-6b14639d/_generated/favicon/apple-touch-icon.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/individual-6b14639d/_generated/favicon/favicon-32x32.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/individual-6b14639d/_generated/favicon/favicon-16x16.png?v=3\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/individual-6b14639d/_generated/favicon/favicon.ico?v=3\">\u003cmeta data-mint-head property=\"og:title\" content=\"한글 퍼지 검색 - hangulpy\">\u003cmeta data-mint-head property=\"og:description\" content=\"자모 거리와 재사용 검색 인덱스로 오타와 초성 검색 처리\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"hangulpy\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://hangulpy.uiharu.dev/api/search/fuzzy-search\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://individual-6b14639d.mintlify.app/_mintlify/api/og/v2?division=%EA%B2%80%EC%83%89%EA%B3%BC+%EB%A7%A4%EC%B9%AD\u0026amp;title=%ED%95%9C%EA%B8%80+%ED%8D%BC%EC%A7%80+%EA%B2%80%EC%83%89\u0026amp;description=%EC%9E%90%EB%AA%A8+%EA%B1%B0%EB%A6%AC%EC%99%80+%EC%9E%AC%EC%82%AC%EC%9A%A9+%EA%B2%80%EC%83%89+%EC%9D%B8%EB%8D%B1%EC%8A%A4%EB%A1%9C+%EC%98%A4%ED%83%80%EC%99%80+%EC%B4%88%EC%84%B1+%EA%B2%80%EC%83%89+%EC%B2%98%EB%A6%AC\u0026amp;theme=b42f8bfeb1aa09269568e646\u0026amp;signature=065ffadfa89e55ded25cd54006c04abc801da0c8cd9345f3861b8359e3525d56\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"한글 퍼지 검색 - hangulpy\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"자모 거리와 재사용 검색 인덱스로 오타와 초성 검색 처리\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://individual-6b14639d.mintlify.app/_mintlify/api/og/v2?division=%EA%B2%80%EC%83%89%EA%B3%BC+%EB%A7%A4%EC%B9%AD\u0026amp;title=%ED%95%9C%EA%B8%80+%ED%8D%BC%EC%A7%80+%EA%B2%80%EC%83%89\u0026amp;description=%EC%9E%90%EB%AA%A8+%EA%B1%B0%EB%A6%AC%EC%99%80+%EC%9E%AC%EC%82%AC%EC%9A%A9+%EA%B2%80%EC%83%89+%EC%9D%B8%EB%8D%B1%EC%8A%A4%EB%A1%9C+%EC%98%A4%ED%83%80%EC%99%80+%EC%B4%88%EC%84%B1+%EA%B2%80%EC%83%89+%EC%B2%98%EB%A6%AC\u0026amp;theme=b42f8bfeb1aa09269568e646\u0026amp;signature=065ffadfa89e55ded25cd54006c04abc801da0c8cd9345f3861b8359e3525d56\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/individual-6b14639d/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"hangulpy\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0f766e\">\u003clink data-mint-head rel=\"canonical\" href=\"https://hangulpy.uiharu.dev/api/search/fuzzy-search\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api/search/fuzzy-search.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://hangulpy.uiharu.dev/#organization\",\"name\":\"hangulpy\",\"url\":\"https://hangulpy.uiharu.dev\"},{\"@type\":\"WebSite\",\"@id\":\"https://hangulpy.uiharu.dev#website\",\"name\":\"hangulpy\",\"url\":\"https://hangulpy.uiharu.dev\",\"publisher\":{\"@id\":\"https://hangulpy.uiharu.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://hangulpy.uiharu.dev/api/search/fuzzy-search#webpage\",\"url\":\"https://hangulpy.uiharu.dev/api/search/fuzzy-search\",\"name\":\"한글 퍼지 검색\",\"description\":\"자모 거리와 재사용 검색 인덱스로 오타와 초성 검색 처리\",\"dateModified\":\"2026-08-09T13:30:36.640Z\",\"isPartOf\":{\"@id\":\"https://hangulpy.uiharu.dev#website\"},\"breadcrumb\":{\"@id\":\"https://hangulpy.uiharu.dev/api/search/fuzzy-search#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://hangulpy.uiharu.dev/api/search/fuzzy-search#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"검색과 매칭\",\"item\":\"https://hangulpy.uiharu.dev/api/search/get-chosung\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"한글 퍼지 검색\",\"item\":\"https://hangulpy.uiharu.dev/api/search/fuzzy-search\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://hangulpy.uiharu.dev/api/search/fuzzy-search#article\",\"headline\":\"한글 퍼지 검색\",\"name\":\"한글 퍼지 검색\",\"description\":\"자모 거리와 재사용 검색 인덱스로 오타와 초성 검색 처리\",\"url\":\"https://hangulpy.uiharu.dev/api/search/fuzzy-search\",\"mainEntityOfPage\":{\"@id\":\"https://hangulpy.uiharu.dev/api/search/fuzzy-search#webpage\"},\"dateModified\":\"2026-08-09T13:30:36.640Z\",\"publisher\":{\"@id\":\"https://hangulpy.uiharu.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://hangulpy.uiharu.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"hangulpy\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"hangulpy","nav":{"global":null,"groups":[{"group":"소개","pages":[{"title":"소개","href":"/index"},{"title":"설치하기","href":"/installation"},{"title":"빠른 시작","href":"/quickstart"},{"title":"기능별 API 찾기","href":"/api/overview"}]},{"group":"검색과 매칭","pages":[{"title":"초성 추출과 초성 비교 (get_chosung_string, chosung_includes)","href":"/api/search/get-chosung"},{"title":"포함 여부 확인 (hangul_contains)","href":"/api/search/hangul-contains"},{"title":"검색 위치 찾기 (hangul_search, hangul_search_all)","href":"/api/search/hangul-search"},{"title":"재사용 검색기 (HangulSearcher)","href":"/api/search/hangul-searcher"},{"title":"한글 인식 치환과 분할","description":"초성·자모 패턴으로 원문을 치환하고 나누는 API","href":"/api/search/hangul-replace"},{"title":"한글 퍼지 검색","href":"/api/search/fuzzy-search"},{"title":"패턴 목록 필터링 (match_hangul_pattern)","description":"한글 패턴으로 단어 목록 필터링","href":"/api/search/match-hangul-pattern"}]},{"group":"조사와 받침","pages":[{"title":"조사 붙이기 (josa)","href":"/api/particles/josa"},{"title":"받침 판별 (has_jongsung, has_batchim, ends_with_consonant)","href":"/api/particles/batchim"},{"title":"자립명사 결합 (jarip_noun)","href":"/api/particles/jarip-noun"}]},{"group":"한글 판별과 추출","pages":[{"title":"한글 여부 판별 (is_hangul, is_hangul_consonant, is_hangul_vowel)","href":"/api/properties/is-hangul"},{"title":"한자 판별과 구간 분리","href":"/api/properties/hanja"},{"title":"음절과 자모 판별 (is_complete_hangul, is_chosung, is_jungsung, is_jongsung)","href":"/api/properties/syllable-types"},{"title":"초·중·종성 사용 가능 여부","href":"/api/properties/jamo-roles"},{"title":"초·중·종성 구성요소 추출","href":"/api/properties/get-components"}]},{"group":"분해와 조합","pages":[{"title":"구조 분해 (decompose_hangul_string)","href":"/api/assembly/decompose-hangul-string"},{"title":"평탄 분해 (split_hangul_string)","href":"/api/assembly/split-hangul-string"},{"title":"자모 분해 (split_syllables, disassemble)","href":"/api/assembly/split-syllables"},{"title":"자모 단위 편집","href":"/api/assembly/jamo-edit"},{"title":"자모 조합","href":"/api/assembly/join-jamos"},{"title":"단일 음절 생성 (hangul_syllable)","href":"/api/assembly/hangul-syllable"}]},{"group":"변환과 정렬","pages":[{"title":"숫자를 한글로 읽기","href":"/api/conversions/number-to-hangul"},{"title":"한글 숫자 복원 (hangul_to_number)","href":"/api/conversions/hangul-to-number"},{"title":"한글 Unicode 정규화","href":"/api/conversions/normalize-hangul"},{"title":"반복 자모와 이모티콘 정리","href":"/api/conversions/reduce-jamo-repeats"},{"title":"로마자 표기 변환 (romanize, Romanizer)","href":"/api/conversions/romanize"},{"title":"키보드 변환과 오타 교정","href":"/api/conversions/keyboard"},{"title":"한글 정렬 (sort_hangul)","href":"/api/conversions/sort-hangul"},{"title":"표준 발음 변환 (standardize_pronunciation)","href":"/api/conversions/standardize-pronunciation"},{"title":"음절 매핑 (map_hangul)","href":"/api/conversions/map-hangul"}]},{"group":"참고 자료","pages":[{"title":"전체 공개 함수 목록","href":"/implemented-features"},{"title":"v1.5 마이그레이션","href":"/migration-v1-5"},{"title":"v1.5.2 릴리즈 노트","href":"/releases/v1-5-2"},{"title":"v1.5.1 릴리즈 노트","href":"/releases/v1-5-1"},{"title":"v1.5.0 릴리즈 노트","href":"/releases/v1-5-0"},{"title":"v1.4.2 릴리즈 노트","href":"/releases/v1-4-2"},{"title":"v1.4.1 릴리즈 노트","href":"/releases/v1-4-1"},{"title":"v1.4.0 릴리즈 노트","href":"/releases/v1-4-0"},{"title":"v1.3.2 릴리즈 노트","href":"/releases/v1-3-2"},{"title":"v1.3.1 릴리즈 노트","href":"/releases/v1-3-1"}]}]},"basePath":"","title":"한글 퍼지 검색 - hangulpy","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":[],"chunks":[]}