ts-textrank
Version:
Typescript TextRank implementation
25 lines (24 loc) • 725 B
TypeScript
import LoggerInterface from "../infraestructure/LoggerInterface";
import { SummarizerConfig } from "./SummarizerConfig";
export default class Summarizer {
static SORT_SCORE: number;
static SORT_OCCURENCE: number;
private logger;
private readonly config;
private graph;
private text;
debug: boolean;
private threshold;
private maxLoops;
constructor(config: SummarizerConfig, logger: LoggerInterface);
summarize(text: string, language: string): string[];
private buildSummary;
/**
* Calculates score for sentence i, returning the error value
* as the difference with previous value
*
* @param i
* @returns error
*/
private calculateScore;
}