UNPKG

bilingual-summarizer

Version:

A powerful text summarization package for Arabic and English content with sentiment analysis and topic extraction

28 lines (27 loc) 1.41 kB
import { SummarizeOptions, SummaryResult, GeminiConfig } from './types'; import { isArabic } from './utils/languageDetection'; import { extractTopics } from './utils/topicExtraction'; import { isGeminiConfigValid } from './extractors/geminiSummarizer'; /** * Summarizes and analyzes the provided text or HTML content * @param content The text or HTML content to summarize * @param options Optional configuration options * @returns A summary result object */ export declare function summarize(content: string, options?: Partial<SummarizeOptions>): Promise<SummaryResult | Record<string, any>>; /** * Direct API to summarize Arabic text using the specialized Arabic summarizer * @param text The Arabic text to summarize * @param sentenceCount The number of sentences to include in the summary * @returns The summarized text */ export declare function summarizeArabic(text: string, sentenceCount?: number): string; /** * Direct API to summarize text using Google's Gemini AI * @param text The text to summarize * @param sentenceCount The number of sentences to include in the summary * @param geminiConfig Configuration for the Gemini API * @returns A promise that resolves to the summarized text */ export declare function summarizeWithAI(text: string, sentenceCount: number | undefined, geminiConfig: GeminiConfig): Promise<string>; export { extractTopics, isArabic, isGeminiConfigValid };