| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System.Collections.Generic; |
| | 5 | | using System.Collections.ObjectModel; |
| | 6 | | using Azure.AI.TextAnalytics.Models; |
| | 7 | |
|
| | 8 | | namespace Azure.AI.TextAnalytics |
| | 9 | | { |
| | 10 | | /// <summary> |
| | 11 | | /// A prediction of the language in which a document is written in. |
| | 12 | | /// </summary> |
| | 13 | | public readonly struct DetectedLanguage |
| | 14 | | { |
| | 15 | | internal DetectedLanguage(DetectedLanguage_internal language, IList<TextAnalyticsWarning> warnings) |
| | 16 | | { |
| 84 | 17 | | Name = language.Name; |
| 84 | 18 | | Iso6391Name = language.Iso6391Name; |
| 84 | 19 | | ConfidenceScore = language.ConfidenceScore; |
| 84 | 20 | | Warnings = new ReadOnlyCollection<TextAnalyticsWarning>(warnings); |
| 84 | 21 | | } |
| | 22 | |
|
| | 23 | | /// <summary> |
| | 24 | | /// Gets the spelled-out name of the detected language (for example, |
| | 25 | | /// "English" or "French"). |
| | 26 | | /// </summary> |
| 68 | 27 | | public string Name { get; } |
| | 28 | |
|
| | 29 | | /// <summary> |
| | 30 | | /// Gets a two letter representation of the detected language |
| | 31 | | /// according to the ISO 639-1 standard (for example, "en" or "fr"). |
| | 32 | | /// </summary> |
| 16 | 33 | | public string Iso6391Name { get; } |
| | 34 | |
|
| | 35 | | /// <summary> |
| | 36 | | /// Gets a confidence score between 0 and 1. Scores close to 1 |
| | 37 | | /// indicate high certainty that the identified language is correct. |
| | 38 | | /// </summary> |
| 16 | 39 | | public double ConfidenceScore { get; } |
| | 40 | |
|
| | 41 | | /// <summary> |
| | 42 | | /// Gets the warnings encountered while processing the document. |
| | 43 | | /// </summary> |
| 0 | 44 | | public IReadOnlyCollection<TextAnalyticsWarning> Warnings { get; } |
| | 45 | | } |
| | 46 | | } |