< Summary

Class:Azure.Search.Documents.Indexes.Models.EntityRecognitionSkill
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\EntityRecognitionSkill.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\EntityRecognitionSkill.Serialization.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\EntityRecognitionSkill.cs
Covered lines:0
Uncovered lines:118
Coverable lines:118
Total lines:261
Line coverage:0% (0 of 118)
Covered branches:0
Total branches:62
Branch coverage:0% (0 of 62)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_DefaultLanguageCode()-0%100%
get_IncludeTypelessEntities()-0%100%
get_MinimumPrecision()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeEntityRecognitionSkill(...)-0%0%
get_Categories()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\EntityRecognitionSkill.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Collections.Generic;
 10using Azure.Core;
 11
 12namespace Azure.Search.Documents.Indexes.Models
 13{
 14    /// <summary> Text analytics entity recognition. </summary>
 15    public partial class EntityRecognitionSkill : SearchIndexerSkill
 16    {
 17        /// <summary> Initializes a new instance of EntityRecognitionSkill. </summary>
 18        /// <param name="inputs"> Inputs of the skills could be a column in the source data set, or the output of an ups
 19        /// <param name="outputs"> The output of a skill is either a field in a search index, or a value that can be con
 20        /// <exception cref="ArgumentNullException"> <paramref name="inputs"/> or <paramref name="outputs"/> is null. </
 021        public EntityRecognitionSkill(IEnumerable<InputFieldMappingEntry> inputs, IEnumerable<OutputFieldMappingEntry> o
 22        {
 023            if (inputs == null)
 24            {
 025                throw new ArgumentNullException(nameof(inputs));
 26            }
 027            if (outputs == null)
 28            {
 029                throw new ArgumentNullException(nameof(outputs));
 30            }
 31
 032            Categories = new ChangeTrackingList<EntityCategory>();
 033            ODataType = "#Microsoft.Skills.Text.EntityRecognitionSkill";
 034        }
 35
 36        /// <summary> Initializes a new instance of EntityRecognitionSkill. </summary>
 37        /// <param name="oDataType"> Identifies the concrete type of the skill. </param>
 38        /// <param name="name"> The name of the skill which uniquely identifies it within the skillset. A skill with no 
 39        /// <param name="description"> The description of the skill which describes the inputs, outputs, and usage of th
 40        /// <param name="context"> Represents the level at which operations take place, such as the document root or doc
 41        /// <param name="inputs"> Inputs of the skills could be a column in the source data set, or the output of an ups
 42        /// <param name="outputs"> The output of a skill is either a field in a search index, or a value that can be con
 43        /// <param name="categories"> A list of entity categories that should be extracted. </param>
 44        /// <param name="defaultLanguageCode"> A value indicating which language code to use. Default is en. </param>
 45        /// <param name="includeTypelessEntities"> Determines whether or not to include entities which are well known bu
 46        /// <param name="minimumPrecision"> A value between 0 and 1 that be used to only include entities whose confiden
 047        internal EntityRecognitionSkill(string oDataType, string name, string description, string context, IList<InputFi
 48        {
 049            Categories = categories;
 050            DefaultLanguageCode = defaultLanguageCode;
 051            IncludeTypelessEntities = includeTypelessEntities;
 052            MinimumPrecision = minimumPrecision;
 053            ODataType = oDataType ?? "#Microsoft.Skills.Text.EntityRecognitionSkill";
 054        }
 55        /// <summary> A value indicating which language code to use. Default is en. </summary>
 056        public EntityRecognitionSkillLanguage? DefaultLanguageCode { get; set; }
 57        /// <summary> Determines whether or not to include entities which are well known but don&apos;t conform to a pre
 058        public bool? IncludeTypelessEntities { get; set; }
 59        /// <summary> A value between 0 and 1 that be used to only include entities whose confidence score is greater th
 060        public double? MinimumPrecision { get; set; }
 61    }
 62}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\EntityRecognitionSkill.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Search.Documents.Indexes.Models
 13{
 14    public partial class EntityRecognitionSkill : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsCollectionDefined(Categories))
 20            {
 021                writer.WritePropertyName("categories");
 022                writer.WriteStartArray();
 023                foreach (var item in Categories)
 24                {
 025                    writer.WriteStringValue(item.ToString());
 26                }
 027                writer.WriteEndArray();
 28            }
 029            if (Optional.IsDefined(DefaultLanguageCode))
 30            {
 031                writer.WritePropertyName("defaultLanguageCode");
 032                writer.WriteStringValue(DefaultLanguageCode.Value.ToString());
 33            }
 034            if (Optional.IsDefined(IncludeTypelessEntities))
 35            {
 036                if (IncludeTypelessEntities != null)
 37                {
 038                    writer.WritePropertyName("includeTypelessEntities");
 039                    writer.WriteBooleanValue(IncludeTypelessEntities.Value);
 40                }
 41                else
 42                {
 043                    writer.WriteNull("includeTypelessEntities");
 44                }
 45            }
 046            if (Optional.IsDefined(MinimumPrecision))
 47            {
 048                if (MinimumPrecision != null)
 49                {
 050                    writer.WritePropertyName("minimumPrecision");
 051                    writer.WriteNumberValue(MinimumPrecision.Value);
 52                }
 53                else
 54                {
 055                    writer.WriteNull("minimumPrecision");
 56                }
 57            }
 058            writer.WritePropertyName("@odata.type");
 059            writer.WriteStringValue(ODataType);
 060            if (Optional.IsDefined(Name))
 61            {
 062                writer.WritePropertyName("name");
 063                writer.WriteStringValue(Name);
 64            }
 065            if (Optional.IsDefined(Description))
 66            {
 067                writer.WritePropertyName("description");
 068                writer.WriteStringValue(Description);
 69            }
 070            if (Optional.IsDefined(Context))
 71            {
 072                writer.WritePropertyName("context");
 073                writer.WriteStringValue(Context);
 74            }
 075            writer.WritePropertyName("inputs");
 076            writer.WriteStartArray();
 077            foreach (var item in Inputs)
 78            {
 079                writer.WriteObjectValue(item);
 80            }
 081            writer.WriteEndArray();
 082            writer.WritePropertyName("outputs");
 083            writer.WriteStartArray();
 084            foreach (var item in Outputs)
 85            {
 086                writer.WriteObjectValue(item);
 87            }
 088            writer.WriteEndArray();
 089            writer.WriteEndObject();
 090        }
 91
 92        internal static EntityRecognitionSkill DeserializeEntityRecognitionSkill(JsonElement element)
 93        {
 094            Optional<IList<EntityCategory>> categories = default;
 095            Optional<EntityRecognitionSkillLanguage> defaultLanguageCode = default;
 096            Optional<bool?> includeTypelessEntities = default;
 097            Optional<double?> minimumPrecision = default;
 098            string odataType = default;
 099            Optional<string> name = default;
 0100            Optional<string> description = default;
 0101            Optional<string> context = default;
 0102            IList<InputFieldMappingEntry> inputs = default;
 0103            IList<OutputFieldMappingEntry> outputs = default;
 0104            foreach (var property in element.EnumerateObject())
 105            {
 0106                if (property.NameEquals("categories"))
 107                {
 0108                    List<EntityCategory> array = new List<EntityCategory>();
 0109                    foreach (var item in property.Value.EnumerateArray())
 110                    {
 0111                        array.Add(new EntityCategory(item.GetString()));
 112                    }
 0113                    categories = array;
 0114                    continue;
 115                }
 0116                if (property.NameEquals("defaultLanguageCode"))
 117                {
 0118                    defaultLanguageCode = new EntityRecognitionSkillLanguage(property.Value.GetString());
 0119                    continue;
 120                }
 0121                if (property.NameEquals("includeTypelessEntities"))
 122                {
 0123                    if (property.Value.ValueKind == JsonValueKind.Null)
 124                    {
 0125                        includeTypelessEntities = null;
 0126                        continue;
 127                    }
 0128                    includeTypelessEntities = property.Value.GetBoolean();
 0129                    continue;
 130                }
 0131                if (property.NameEquals("minimumPrecision"))
 132                {
 0133                    if (property.Value.ValueKind == JsonValueKind.Null)
 134                    {
 0135                        minimumPrecision = null;
 0136                        continue;
 137                    }
 0138                    minimumPrecision = property.Value.GetDouble();
 0139                    continue;
 140                }
 0141                if (property.NameEquals("@odata.type"))
 142                {
 0143                    odataType = property.Value.GetString();
 0144                    continue;
 145                }
 0146                if (property.NameEquals("name"))
 147                {
 0148                    name = property.Value.GetString();
 0149                    continue;
 150                }
 0151                if (property.NameEquals("description"))
 152                {
 0153                    description = property.Value.GetString();
 0154                    continue;
 155                }
 0156                if (property.NameEquals("context"))
 157                {
 0158                    context = property.Value.GetString();
 0159                    continue;
 160                }
 0161                if (property.NameEquals("inputs"))
 162                {
 0163                    List<InputFieldMappingEntry> array = new List<InputFieldMappingEntry>();
 0164                    foreach (var item in property.Value.EnumerateArray())
 165                    {
 0166                        array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item));
 167                    }
 0168                    inputs = array;
 0169                    continue;
 170                }
 0171                if (property.NameEquals("outputs"))
 172                {
 0173                    List<OutputFieldMappingEntry> array = new List<OutputFieldMappingEntry>();
 0174                    foreach (var item in property.Value.EnumerateArray())
 175                    {
 0176                        array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item));
 177                    }
 0178                    outputs = array;
 179                    continue;
 180                }
 181            }
 0182            return new EntityRecognitionSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, 
 183        }
 184    }
 185}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\EntityRecognitionSkill.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Collections.Generic;
 5using Azure.Core;
 6
 7namespace Azure.Search.Documents.Indexes.Models
 8{
 9    public partial class EntityRecognitionSkill
 10    {
 11        /// <summary> A list of entity categories that should be extracted. </summary>
 012        public IList<EntityCategory> Categories { get; }
 13    }
 14}