Beispiel #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)));
        }
 /// <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);
 }
 /// <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>();
 }
 internal DetectLanguageResult(string id, TextDocumentStatistics statistics, IList <DetectedLanguage> detectedLanguages)
     : base(id, statistics)
 {
     DetectedLanguages = new ReadOnlyCollection <DetectedLanguage>(detectedLanguages);
 }
Beispiel #6
0
 internal RecognizePiiEntitiesResult(string id, TextDocumentStatistics statistics, IList <PiiEntity> entities)
     : base(id, statistics)
 {
     _entities = new ReadOnlyCollection <PiiEntity>(entities);
 }
 internal RecognizeLinkedEntitiesResult(string id, TextDocumentStatistics statistics, IList <LinkedEntity> linkedEntities)
     : base(id, statistics)
 {
     _linkedEntities = new ReadOnlyCollection <LinkedEntity>(linkedEntities);
 }
Beispiel #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));
 }
 internal RecognizeEntitiesResult(string id, TextDocumentStatistics statistics, CategorizedEntityCollection entities)
     : base(id, statistics)
 {
     _entities = entities;
 }
Beispiel #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));
 }
Beispiel #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));
 }
 internal RecognizeLinkedEntitiesResult(string id, TextDocumentStatistics statistics, LinkedEntityCollection linkedEntities)
     : base(id, statistics)
 {
     _linkedEntities = linkedEntities;
 }
Beispiel #13
0
 internal DetectLanguageResult(string id, TextDocumentStatistics statistics, DetectedLanguage detectedLanguage)
     : base(id, statistics)
 {
     _primaryLanguage = detectedLanguage;
 }
Beispiel #14
0
 internal SingleCategoryClassifyResult(string id, TextDocumentStatistics statistics, ClassificationCategory classificationCategory, IReadOnlyCollection <TextAnalyticsWarning> warnings)
     : base(id, statistics)
 {
     _classification = classificationCategory;
     Warnings        = warnings;
 }
Beispiel #15
0
 internal ExtractSummaryResult(string id, TextDocumentStatistics statistics, SummarySentenceCollection sentences)
     : base(id, statistics)
 {
     _sentences = sentences;
 }
 internal AnalyzeSentimentResult(string id, TextDocumentStatistics statistics, TextSentiment documentSentiment, IList <TextSentiment> sentenceSentiments)
     : base(id, statistics)
 {
     DocumentSentiment  = documentSentiment;
     SentenceSentiments = new ReadOnlyCollection <TextSentiment>(sentenceSentiments);
 }
Beispiel #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));
 }
 internal AnalyzeSentimentResult(string id, TextDocumentStatistics statistics, DocumentSentiment documentSentiment)
     : base(id, statistics)
 {
     _documentSentiment = documentSentiment;
 }
Beispiel #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));
 }
 internal ExtractKeyPhrasesResult(string id, TextDocumentStatistics statistics, IList <string> keyPhrases)
     : base(id, statistics)
 {
     KeyPhrases = new ReadOnlyCollection <string>(keyPhrases);
 }
Beispiel #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));
 }
 internal ExtractKeyPhrasesResult(string id, TextDocumentStatistics statistics, KeyPhraseCollection keyPhrases)
     : base(id, statistics)
 {
     _keyPhrases = keyPhrases;
 }