forked from JoeEager/OpenTextSummarizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSummarizerArguments.cs
55 lines (44 loc) · 1.54 KB
/
SummarizerArguments.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using OpenTextSummarizer.Interfaces;
using System;
namespace OpenTextSummarizer
{
public class SummarizerArguments : ISummarizerArguments
{
public int FilteringConceptsCap { get; set; }
public int MaxSummarySentences { get; set; }
public int MaxSummarySizeInPercent { get; set; }
public string Language { get; set; }
public SummarizerArguments()
{
Language = "en";
FilteringConceptsCap = 5;
MaxSummarySentences = 10;
MaxSummarySizeInPercent = 10;
ContentParser = () => new ClassicContentParser(Rules, new TextUnitBuilder(Rules));
ContentAnalyzer = () => new ClassicContentAnalyzer(Rules);
ContentSummarizer = () => new ClassicContentSummarizer();
}
private Dictionary m_Rules = null;
private object m_RulesLock = new object();
internal Dictionary Rules
{
get
{
if (m_Rules == null)
{
lock (m_RulesLock)
{
if (m_Rules == null)
{
m_Rules = Dictionary.LoadFromFile(Language);
}
}
}
return m_Rules;
}
}
public Func<IContentParser> ContentParser { get; set; }
public Func<IContentAnalyzer> ContentAnalyzer { get; set; }
public Func<IContentSummarizer> ContentSummarizer { get; set; }
}
}