-
Notifications
You must be signed in to change notification settings - Fork 0
/
TextMinerResponse.cs
executable file
·122 lines (105 loc) · 3.16 KB
/
TextMinerResponse.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Strider.Client.TextMiner.Client
{
public class TextMinerResponse
{
private int articleId;
private string source;
private string author;
private string title;
private Uri url;
private string summary;
private string timeStamp;
private string processedIn;
private string languageCode;
private List<string> tagList = null;
private Dictionary<string, string> categoryDict = null;
public int ArticleId
{
get { return articleId; }
set { articleId = value; }
}
public string Source
{
get { return source; }
set { source = value; }
}
public string Title
{
get { return title; }
set { title = value; }
}
public string Author
{
get { return author; }
set { author = value; }
}
public Uri Url
{
get { return url; }
set { url = value; }
}
public string Summary
{
get { return summary; }
set { summary = value; }
}
public string Timestamp
{
get { return timeStamp; }
set { timeStamp = value; }
}
public string ProcessedIn
{
get { return processedIn; }
set { processedIn = value; }
}
public string LanguageCode
{
get { return languageCode; }
set { languageCode = value; }
}
public List<string> TagList
{
get { return tagList; }
set { tagList = value; }
}
public Dictionary<string, string> CategoryDict
{
get { return categoryDict; }
set { categoryDict = value; }
}
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("Requested artcle id: " + ArticleId);
sb.AppendLine("Source: " + Source);
sb.AppendLine("Author: " + Author);
sb.AppendLine("Title: " + Title);
sb.AppendLine("URL: " + Url);
sb.AppendLine("Summary: " + Summary);
sb.AppendLine("TimeStamp: " + timeStamp);
sb.AppendLine("Processed In: " + processedIn);
if (tagList != null && tagList.Count > 0)
{
sb.Append("Tags: ");
foreach (string tag in tagList)
{
sb.Append(" " + tag + "\n");
}
}
if (categoryDict != null && categoryDict.Count > 0)
{
sb.Append("Categories: ");
foreach (var cat in categoryDict)
{
sb.Append(" " + cat.Key + ":" + cat.Value + "\n");
}
}
return sb.ToString();
}
}
}