Skip to content

Commit 1db4b3e

Browse files
committed
Adding single object testing
1 parent 27c1a0a commit 1db4b3e

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/Sentiment/Wikiled.Sentiment.Analysis/Processing/ITestingClient.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Threading.Tasks;
23
using Wikiled.MachineLearning.Mathematics;
34
using Wikiled.Sentiment.Analysis.Pipeline;
45
using Wikiled.Sentiment.Text.Aspects;
@@ -43,6 +44,8 @@ public interface ITestingClient
4344

4445
IObservable<ProcessingContext> Process(IObservable<IParsedDocumentHolder> reviews);
4546

47+
Task<ProcessingContext> Process(IParsedDocumentHolder review);
48+
4649
void Save(string path);
4750
}
4851
}

src/Sentiment/Wikiled.Sentiment.Analysis/Processing/TestingClient.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.IO;
44
using System.Reactive.Linq;
55
using System.Threading;
6+
using System.Threading.Tasks;
67
using System.Xml.Linq;
78
using Wikiled.Arff.Extensions;
89
using Wikiled.Arff.Logic;
@@ -140,6 +141,17 @@ public IObservable<ProcessingContext> Process(IObservable<IParsedDocumentHolder>
140141
return documentSelector;
141142
}
142143

144+
public async Task<ProcessingContext> Process(IParsedDocumentHolder review)
145+
{
146+
if (review == null)
147+
{
148+
throw new ArgumentNullException(nameof(review));
149+
}
150+
151+
var result = await Process(Observable.Never<IParsedDocumentHolder>().StartWith(review));
152+
return result;
153+
}
154+
143155
public void Save(string path)
144156
{
145157
path.EnsureDirectoryExistence();

0 commit comments

Comments
 (0)