forked from vrittis/OpenTextSummarizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Summarizer.cs
23 lines (19 loc) · 798 Bytes
/
Summarizer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using OpenTextSummarizer.Interfaces;
namespace OpenTextSummarizer
{
public class Summarizer
{
public static SummarizedDocument Summarize(IContentProvider contentProvider, ISummarizerArguments args)
{
if (contentProvider == null || args == null)
{
return new SummarizedDocument();
}
var engine = new SummarizingEngine();
var parsedDocument = engine.ParseContent(contentProvider, args.ContentParser());
var analyzedDocument = engine.AnalyzeParsedContent(parsedDocument, args.ContentAnalyzer());
var summaryAnalysisDocument = engine.SummarizeAnalysedContent(analyzedDocument, args.ContentSummarizer(), args);
return summaryAnalysisDocument;
}
}
}