/** * Python Language Index Module * * Provides Python-aware code search using: * - AST parsing via tree-sitter (with regex fallback) * - Local text embeddings for semantic similarity * - BM25 keyword matching for fast filtering * * Supported file types: .py, .pyw * * Index location: .raggrep/index/language/python/ */ import { IndexModule, IndexContext, SearchContext, SearchOptions, FileIndex, SearchResult, ModuleConfig } from "../../../types"; /** Default minimum similarity score for search results */ export declare const DEFAULT_MIN_SCORE = 0.15; /** Default number of results to return */ export declare const DEFAULT_TOP_K = 10; /** File extensions supported by this module */ export declare const PYTHON_EXTENSIONS: string[]; /** * Check if a file is supported by this module. */ export declare function isPythonFile(filepath: string): boolean; export declare const supportsFile: typeof isPythonFile; /** * Module-specific data stored alongside file index. */ export interface PythonModuleData { embeddings: number[][]; embeddingModel: string; [key: string]: unknown; } export declare class PythonModule implements IndexModule { readonly id = "language/python"; readonly name = "Python Search"; readonly description = "Python-aware code search with AST parsing and semantic embeddings"; readonly version = "1.0.0"; supportsFile(filepath: string): boolean; private embeddingConfig; private symbolicIndex; private literalIndex; private pendingSummaries; private pendingLiterals; private rootDir; private logger; initialize(config: ModuleConfig): Promise; indexFile(filepath: string, content: string, ctx: IndexContext): Promise; /** * Regex-based fallback parser for Python. * Used when tree-sitter is not available. */ private parsePythonRegex; /** * Create file index from parsed chunks. */ private createFileIndex; finalize(ctx: IndexContext): Promise; search(query: string, ctx: SearchContext, options?: SearchOptions): Promise; }