/** * Entity Resolution Module * * 5-stage pipeline for resolving entity names to canonical URLs: * 1. Wikidata API - SPARQL search by title + type * 2. Open Library API - Books only, physical formats with covers * 3. Google Search API - Broad search fallback * 4. Heuristic Matching - Rule-based, preferred sources * 5. AI Classification - Gemini ranking for ambiguous results */ import type { EntityType, ResolvedEntity, ResolverConfig } from './types'; import { EXTERNAL_ID_URL_TEMPLATES } from './types'; export { classificationToMatch, classifyItem, classifyItems, getBestUrl } from './classification'; export { buildSearchQuery, searchGoogle, searchGoogleForEntity } from './google'; export { applyHeuristics, extractContentWords, getCanonicalUrl, getSource, normalizeUnicode, tryHeuristicMatch } from './heuristics'; export { searchOpenLibrary } from './openlibrary'; export * from './types'; export { searchWikidata } from './wikidata'; /** * Resolve an entity to its canonical URL and metadata. * * Runs the 5-stage resolution pipeline: * 1. Wikidata API (if enabled) * 2. Open Library API (for books, if enabled) * 3. Google Search API (if configured) * 4. Heuristic matching * 5. AI classification (if configured and heuristics fail) * * @param query - Entity name to resolve (e.g., "The Matrix", "Pride and Prejudice") * @param type - Entity type for filtering (movie, book, etc.) * @param config - Resolver configuration * @returns ResolvedEntity if found, null otherwise */ export declare function resolveEntity(query: string, type: EntityType, config?: ResolverConfig): Promise; /** * Resolve a book entity with author hint. * * Similar to resolveEntity but includes author for better matching. * * @param title - Book title * @param author - Author name (optional but improves accuracy) * @param config - Resolver configuration * @returns ResolvedEntity if found, null otherwise */ export declare function resolveBook(title: string, author: string | undefined, config?: ResolverConfig): Promise; /** * Build canonical URL from external ID. * * @param idType - External ID type (imdb, goodreads, etc.) * @param id - The ID value * @returns Canonical URL or null if template not found */ export declare function buildCanonicalUrl(idType: keyof typeof EXTERNAL_ID_URL_TEMPLATES, id: string): string | null; //# sourceMappingURL=index.d.ts.map