-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
TextAnalyticsResult.cs
50 lines (44 loc) · 1.67 KB
/
TextAnalyticsResult.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace Azure.AI.TextAnalytics
{
/// <summary>
/// Base type for results of Text Analytics operations corresponding to a
/// document. If the operation is unsuccessful, the Id and
/// Error properties will be populated, but not others.
/// </summary>
public class TextAnalyticsResult
{
internal TextAnalyticsResult(string id, TextDocumentStatistics statistics)
{
Id = id;
Statistics = statistics;
}
internal TextAnalyticsResult(string id, TextAnalyticsError error)
{
Id = id;
Error = error;
}
/// <summary>
/// Gets the unique identifier for the document that generated
/// the result.
/// </summary>
public string Id { get; }
/// <summary>
/// Gets statistics about the document and how it was processed by
/// the service. This property will have a value when IncludeStatistics
/// is set to true in the client call.
/// </summary>
public TextDocumentStatistics Statistics { get; }
/// <summary>
/// Gets the error explaining why the operation failed on this
/// document. This property will have a value only when the document
/// cannot be processed.
/// </summary>
public TextAnalyticsError Error { get; }
/// <summary>
/// Indicates that the document was not successfully processed and an error was returned for this document.
/// </summary>
public bool HasError => Error.ErrorCode != default;
}
}