コード例 #1
0
 internal AnalyzeHealthcareEntitiesResult(string id, TextDocumentStatistics statistics,
                                          IList <HealthcareEntity> healthcareEntities,
                                          IList <TextAnalyticsWarning> warnings)
     : base(id, statistics)
 {
     _entities = new ReadOnlyCollection <HealthcareEntity>(healthcareEntities);
     Warnings  = new ReadOnlyCollection <TextAnalyticsWarning>(warnings);
 }
        internal static DocumentHealthcareEntitiesInternal DeserializeDocumentHealthcareEntitiesInternal(JsonElement element)
        {
            string id = default;
            IReadOnlyList <HealthcareEntityInternal>     entities   = default;
            IReadOnlyList <HealthcareRelationInternal>   relations  = default;
            IReadOnlyList <TextAnalyticsWarningInternal> warnings   = default;
            Optional <TextDocumentStatistics>            statistics = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("entities"))
                {
                    List <HealthcareEntityInternal> array = new List <HealthcareEntityInternal>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(HealthcareEntityInternal.DeserializeHealthcareEntityInternal(item));
                    }
                    entities = array;
                    continue;
                }
                if (property.NameEquals("relations"))
                {
                    List <HealthcareRelationInternal> array = new List <HealthcareRelationInternal>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(HealthcareRelationInternal.DeserializeHealthcareRelationInternal(item));
                    }
                    relations = array;
                    continue;
                }
                if (property.NameEquals("warnings"))
                {
                    List <TextAnalyticsWarningInternal> array = new List <TextAnalyticsWarningInternal>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(TextAnalyticsWarningInternal.DeserializeTextAnalyticsWarningInternal(item));
                    }
                    warnings = array;
                    continue;
                }
                if (property.NameEquals("statistics"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    statistics = TextDocumentStatistics.DeserializeTextDocumentStatistics(property.Value);
                    continue;
                }
            }
            return(new DocumentHealthcareEntitiesInternal(id, entities, relations, warnings, Optional.ToNullable(statistics)));
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AnalyzeHealthcareEntitiesResult"/>.
 /// </summary>
 internal AnalyzeHealthcareEntitiesResult(string id, TextDocumentStatistics statistics,
                                          IList <HealthcareEntity> healthcareEntities,
                                          IList <HealthcareEntityRelation> entityRelations,
                                          IList <TextAnalyticsWarning> warnings,
                                          IDictionary <string, object> fhirBundle)
     : this(id, statistics, healthcareEntities, entityRelations, warnings)
 {
     FhirBundle = new ReadOnlyDictionary <string, object>(fhirBundle);
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AnalyzeHealthcareEntitiesResult"/>.
 /// </summary>
 internal AnalyzeHealthcareEntitiesResult(string id, TextDocumentStatistics statistics,
                                          IList <HealthcareEntity> healthcareEntities,
                                          IList <HealthcareEntityRelation> entityRelations,
                                          IList <TextAnalyticsWarning> warnings)
     : base(id, statistics)
 {
     _entities       = new ReadOnlyCollection <HealthcareEntity>(healthcareEntities);
     Warnings        = new ReadOnlyCollection <TextAnalyticsWarning>(warnings);
     EntityRelations = new ReadOnlyCollection <HealthcareEntityRelation>(entityRelations);
     FhirBundle      = new Dictionary <string, object>();
 }
コード例 #5
0
 internal DetectLanguageResult(string id, TextDocumentStatistics statistics, IList <DetectedLanguage> detectedLanguages)
     : base(id, statistics)
 {
     DetectedLanguages = new ReadOnlyCollection <DetectedLanguage>(detectedLanguages);
 }
コード例 #6
0
 internal RecognizePiiEntitiesResult(string id, TextDocumentStatistics statistics, IList <PiiEntity> entities)
     : base(id, statistics)
 {
     _entities = new ReadOnlyCollection <PiiEntity>(entities);
 }
コード例 #7
0
 internal RecognizeLinkedEntitiesResult(string id, TextDocumentStatistics statistics, IList <LinkedEntity> linkedEntities)
     : base(id, statistics)
 {
     _linkedEntities = new ReadOnlyCollection <LinkedEntity>(linkedEntities);
 }
コード例 #8
0
 /// <summary>
 /// Initializes a new instance of <see cref="TextAnalytics.ExtractKeyPhrasesResult"/> for mocking purposes.
 /// </summary>
 /// <param name="id">Sets the <see cref="TextAnalyticsResult.Id"/> property.</param>
 /// <param name="statistics">Sets the <see cref="TextAnalyticsResult.Statistics"/> property.</param>
 /// <param name="keyPhrases">Sets the <see cref="ExtractKeyPhrasesResult.KeyPhrases"/> property.</param>
 /// <returns>A new instance of <see cref="TextAnalytics.ExtractKeyPhrasesResult"/> for mocking purposes.</returns>
 public static ExtractKeyPhrasesResult ExtractKeyPhrasesResult(string id, TextDocumentStatistics statistics, IList <string> keyPhrases)
 {
     return(new ExtractKeyPhrasesResult(id, statistics, keyPhrases));
 }
コード例 #9
0
 internal RecognizeEntitiesResult(string id, TextDocumentStatistics statistics, CategorizedEntityCollection entities)
     : base(id, statistics)
 {
     _entities = entities;
 }
コード例 #10
0
 /// <summary>
 /// Initializes a new instance of <see cref="TextAnalytics.ExtractKeyPhrasesResult"/> for mocking purposes.
 /// </summary>
 /// <param name="id">Sets the <see cref="TextAnalyticsResult.Id"/> property.</param>
 /// <param name="statistics">Sets the <see cref="TextAnalyticsResult.Statistics"/> property.</param>
 /// <param name="keyPhrases">Sets the <see cref="ExtractKeyPhrasesResult.KeyPhrases"/> property.</param>
 /// <returns>A new instance of <see cref="TextAnalytics.ExtractKeyPhrasesResult"/> for mocking purposes.</returns>
 public static ExtractKeyPhrasesResult ExtractKeyPhrasesResult(string id, TextDocumentStatistics statistics, KeyPhraseCollection keyPhrases)
 {
     return(new ExtractKeyPhrasesResult(id, statistics, keyPhrases));
 }
コード例 #11
0
 /// <summary>
 /// Initializes a new instance of <see cref="TextAnalytics.DetectLanguageResult"/> for mocking purposes.
 /// </summary>
 /// <param name="id">Sets the <see cref="TextAnalyticsResult.Id"/> property.</param>
 /// <param name="statistics">Sets the <see cref="TextAnalyticsResult.Statistics"/> property.</param>
 /// <param name="detectedLanguage">Sets the <see cref="TextAnalytics.DetectedLanguage"/> property.</param>
 /// <returns>A new instance of <see cref="TextAnalytics.DetectLanguageResult"/> for mocking purposes.</returns>
 public static DetectLanguageResult DetectLanguageResult(string id, TextDocumentStatistics statistics, DetectedLanguage detectedLanguage)
 {
     return(new DetectLanguageResult(id, statistics, detectedLanguage));
 }
コード例 #12
0
 internal RecognizeLinkedEntitiesResult(string id, TextDocumentStatistics statistics, LinkedEntityCollection linkedEntities)
     : base(id, statistics)
 {
     _linkedEntities = linkedEntities;
 }
コード例 #13
0
 internal DetectLanguageResult(string id, TextDocumentStatistics statistics, DetectedLanguage detectedLanguage)
     : base(id, statistics)
 {
     _primaryLanguage = detectedLanguage;
 }
コード例 #14
0
 internal SingleCategoryClassifyResult(string id, TextDocumentStatistics statistics, ClassificationCategory classificationCategory, IReadOnlyCollection <TextAnalyticsWarning> warnings)
     : base(id, statistics)
 {
     _classification = classificationCategory;
     Warnings        = warnings;
 }
コード例 #15
0
 internal ExtractSummaryResult(string id, TextDocumentStatistics statistics, SummarySentenceCollection sentences)
     : base(id, statistics)
 {
     _sentences = sentences;
 }
コード例 #16
0
 internal AnalyzeSentimentResult(string id, TextDocumentStatistics statistics, TextSentiment documentSentiment, IList <TextSentiment> sentenceSentiments)
     : base(id, statistics)
 {
     DocumentSentiment  = documentSentiment;
     SentenceSentiments = new ReadOnlyCollection <TextSentiment>(sentenceSentiments);
 }
コード例 #17
0
 /// <summary>
 /// Initializes a new instance of <see cref="TextAnalytics.AnalyzeSentimentResult"/> for mocking purposes.
 /// </summary>
 /// <param name="id">Sets the <see cref="TextAnalyticsResult.Id"/> property.</param>
 /// <param name="statistics">Sets the <see cref="TextAnalyticsResult.Statistics"/> property.</param>
 /// <param name="documentSentiment">Sets the <see cref="AnalyzeSentimentResult.DocumentSentiment"/> property.</param>
 /// <returns>A new instance of <see cref="TextAnalytics.AnalyzeSentimentResult"/> for mocking purposes.</returns>
 public static AnalyzeSentimentResult AnalyzeSentimentResult(string id, TextDocumentStatistics statistics, DocumentSentiment documentSentiment)
 {
     return(new AnalyzeSentimentResult(id, statistics, documentSentiment));
 }
コード例 #18
0
 internal AnalyzeSentimentResult(string id, TextDocumentStatistics statistics, DocumentSentiment documentSentiment)
     : base(id, statistics)
 {
     _documentSentiment = documentSentiment;
 }
コード例 #19
0
 /// <summary>
 /// Initializes a new instance of <see cref="TextAnalytics.RecognizeEntitiesResult"/> for mocking purposes.
 /// </summary>
 /// <param name="id">Sets the <see cref="TextAnalyticsResult.Id"/> property.</param>
 /// <param name="statistics">Sets the <see cref="TextAnalyticsResult.Statistics"/> property.</param>
 /// <param name="entities">Sets the collection of <see cref="TextAnalytics.CategorizedEntity"/>.</param>
 /// <returns>A new instance of <see cref="TextAnalytics.RecognizeEntitiesResult"/> for mocking purposes.</returns>
 public static RecognizeEntitiesResult RecognizeEntitiesResult(string id, TextDocumentStatistics statistics, CategorizedEntityCollection entities)
 {
     return(new RecognizeEntitiesResult(id, statistics, entities));
 }
コード例 #20
0
 internal ExtractKeyPhrasesResult(string id, TextDocumentStatistics statistics, IList <string> keyPhrases)
     : base(id, statistics)
 {
     KeyPhrases = new ReadOnlyCollection <string>(keyPhrases);
 }
コード例 #21
0
 /// <summary>
 /// Initializes a new instance of <see cref="TextAnalytics.RecognizeLinkedEntitiesResult"/> for mocking purposes.
 /// </summary>
 /// <param name="id">Sets the <see cref="TextAnalyticsResult.Id"/> property.</param>
 /// <param name="statistics">Sets the <see cref="TextAnalyticsResult.Statistics"/> property.</param>
 /// <param name="linkedEntities">Sets the collection of <see cref="TextAnalytics.LinkedEntity"/>.</param>
 /// <returns>A new instance of <see cref="TextAnalytics.RecognizeLinkedEntitiesResult"/> for mocking purposes.</returns>
 public static RecognizeLinkedEntitiesResult RecognizeLinkedEntitiesResult(string id, TextDocumentStatistics statistics, LinkedEntityCollection linkedEntities)
 {
     return(new RecognizeLinkedEntitiesResult(id, statistics, linkedEntities));
 }
コード例 #22
0
 internal ExtractKeyPhrasesResult(string id, TextDocumentStatistics statistics, KeyPhraseCollection keyPhrases)
     : base(id, statistics)
 {
     _keyPhrases = keyPhrases;
 }