/** * Query Intent Classification * * Keyword-based classification to determine what type of content * the user is likely searching for, and which sources are most relevant. * Enhanced with location/date/entity extraction for research planning. * @module core/search/intent */ export type QueryIntent = 'heritage' | 'natural_history' | 'government' | 'media' | 'newspaper' | 'photograph' | 'genealogy' | 'geographic' | 'general'; export interface IntentResult { /** Detected intent */ intent: QueryIntent; /** Confidence score (0-1) */ confidence: number; /** Sources recommended for this intent */ recommendedSources: string[]; /** Keywords that triggered this intent */ matchedKeywords: string[]; } /** Research intent for planning purposes */ export type ResearchIntent = 'discovery' | 'verification' | 'deep-dive' | 'comparison'; /** Entity types that can be researched */ export type EntityType = 'person' | 'place' | 'event' | 'object' | 'organisation'; /** Location match from GHAP validation */ export interface LocationMatch { /** Place name as found in query */ name: string; /** Australian state (from GHAP lookup) */ state?: string; /** GHAP place ID for further enrichment */ ghapId?: string; /** Whether this was validated via GHAP */ validated: boolean; } /** Date range extracted from query */ export interface ExtractedDateRange { from?: string; to?: string; /** Original text that was parsed */ original: string; /** Confidence in extraction (0-1) */ confidence: number; } /** Full intent analysis for research planning */ export interface IntentAnalysis { /** Multiple themes detected (sports, architecture, etc.) */ themes: string[]; /** Place names detected and validated */ locations: LocationMatch[]; /** Extracted date range */ dateRange: ExtractedDateRange | null; /** Entity types being researched */ entityTypes: EntityType[]; /** Research intent */ intent: ResearchIntent; /** Overall confidence score (0-1) */ confidence: number; /** Original query for reference */ query: string; /** Legacy intent result for backward compat */ legacyIntent: IntentResult; } /** * Classify query intent based on keyword matching. * * @param query - Search query string * @returns Intent classification with confidence and recommendations */ export declare function classifyIntent(query: string): IntentResult; /** * Get recommended sources for an intent. * * @param intent - Query intent * @returns Array of source identifiers */ export declare function getSourcesForIntent(intent: QueryIntent): string[]; /** * Extract potential place names from query using heuristics. * Looks for capitalised multi-word terms that might be place names. * * @param query - Search query string * @returns Array of potential place name strings */ export declare function extractPotentialLocations(query: string): string[]; /** * Validate potential location names via GHAP lookup. * Returns validated locations with state info and GHAP IDs. * * @param potentialLocations - Array of potential place names * @returns Array of validated location matches */ export declare function validateLocationsViaGHAP(potentialLocations: string[]): Promise; /** * Extract date range from query using pattern matching. * * @param query - Search query string * @returns Extracted date range or null if none found */ export declare function extractDateRange(query: string): ExtractedDateRange | null; /** * Extract entity types being researched from query. * * @param query - Search query string * @returns Array of detected entity types */ export declare function extractEntityTypes(query: string): EntityType[]; /** * Extract themes from query using keyword matching. * * @param query - Search query string * @returns Array of detected theme strings */ export declare function extractThemes(query: string): string[]; /** * Classify research intent from query. * * @param query - Search query string * @returns Research intent classification */ export declare function classifyResearchIntent(query: string): ResearchIntent; /** * Detect Australian state from query. * * @param query - Search query string * @returns State abbreviation or undefined */ export declare function detectState(query: string): string | undefined; /** * Perform full intent analysis for research planning. * This is async because it uses GHAP for location validation. * * @param query - Search query string * @returns Full intent analysis with themes, locations, dates, and entity types */ export declare function analyzeIntent(query: string): Promise; //# sourceMappingURL=intent.d.ts.map