UNPKG

@solapi/mcp-server

Version:

MCP server for SOLAPI document search and integration

96 lines 2.83 kB
/** * @file 검색 인덱스 관리자 * @description 예제 데이터의 빠른 검색을 위한 인덱스를 생성하고 관리합니다. */ import type { Example } from '../types'; export interface SearchIndex { keywordIndex: Map<string, Set<string>>; categoryIndex: Map<string, Set<string>>; languageIndex: Map<string, Set<string>>; titleIndex: Map<string, Set<string>>; descriptionIndex: Map<string, Set<string>>; } export declare class SdkIndexManager { private static instance; private index; private examples; private synonyms; private constructor(); static getInstance(): SdkIndexManager; /** * 유사어 사전을 초기화합니다. */ private initializeSynonyms; /** * 모든 예제 데이터로 인덱스를 구축합니다. */ buildIndex(examples: Example[]): void; /** * 단일 예제를 인덱스에 추가합니다. */ private addToIndex; /** * 예제의 언어를 감지합니다. */ private detectLanguage; /** * 텍스트에서 검색 가능한 단어들을 추출합니다. */ private extractWords; /** * 불용어를 확인합니다. */ private isStopWord; /** * 키워드로 예제 ID들을 검색합니다. (유사어 및 부분 매칭 지원) */ searchByKeyword(keyword: string): string[]; /** * 카테고리로 예제 ID들을 검색합니다. */ searchByCategory(category: string): string[]; /** * 언어로 예제 ID들을 검색합니다. */ searchByLanguage(language: string): string[]; /** * 제목에서 단어로 검색합니다. */ searchByTitle(word: string): string[]; /** * 설명에서 단어로 검색합니다. */ searchByDescription(word: string): string[]; /** * 복합 검색을 수행합니다. (개선된 유사어 및 부분 매칭) */ searchComplex(query: string, category?: string, language?: string): string[]; /** * 예제 ID로 실제 예제 객체를 반환합니다. */ getExampleById(id: string): Example | undefined; /** * 예제 ID 배열로 실제 예제 객체들을 반환합니다. */ getExamplesByIds(ids: string[]): Example[]; /** * 인덱스 통계를 반환합니다. */ getIndexStats(): { totalExamples: number; keywordCount: number; categoryCount: number; languageCount: number; titleWordCount: number; descriptionWordCount: number; }; /** * 모든 인덱스를 초기화합니다. */ clearIndex(): void; /** * 특정 예제를 인덱스에서 제거합니다. */ removeFromIndex(exampleId: string): void; } //# sourceMappingURL=sdkIndexManager.d.ts.map