UNPKG

code-auditor-mcp

Version:

TypeScript/JavaScript code quality auditor with MCP server - Analyze code for SOLID principles, DRY violations, security patterns, and more

60 lines 2.07 kB
import { ParsedQuery } from '../types'; /** * QueryParser - Parses search queries into structured format with tokenization and synonym expansion * * Supports: * - Multi-word queries with intelligent tokenization * - Exact phrase matching with quotes * - Excluded terms with minus operator * - Special operators (type:, param:, return:, etc.) * - Synonym expansion for common programming terms * - Fuzzy search and stemming flags */ export declare class QueryParser { private static readonly SYNONYMS; private static readonly OPERATORS; /** * Parse a search query string into a structured ParsedQuery object * @param query The raw search query string * @returns ParsedQuery object with extracted terms, filters, and options */ parse(query: string): ParsedQuery; /** * Extract quoted phrases from the query * @param query The query string * @returns Array of phrase objects with original and cleaned value */ private extractPhrases; /** * Extract operators and their values from the query * @param query The query string * @returns Object with operators map and cleaned query */ private extractOperators; /** * Apply operator filters to the parsed query * @param operators Map of operators and values * @param parsedQuery The parsed query object to update */ private applyOperatorFilters; /** * Tokenize a string into individual words * @param text The text to tokenize * @returns Array of tokens */ private tokenize; /** * Get synonyms for a given term * @param term The term to find synonyms for * @returns Array of synonyms (not including the original term) */ getSynonyms(term: string): string[]; /** * Expand a query with synonyms (utility method) * @param query The original query * @returns Expanded query with synonyms */ expandQuery(query: string): string; } export declare const queryParser: QueryParser; //# sourceMappingURL=QueryParser.d.ts.map