< Summary

Class:Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring.Models.EntityPrediction
Assembly:Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.LUIS.Authoring\src\Generated\Models\EntityPrediction.cs
Covered lines:0
Uncovered lines:23
Coverable lines:23
Total lines:116
Line coverage:0% (0 of 23)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_EntityName()-0%100%
get_StartTokenIndex()-0%100%
get_EndTokenIndex()-0%100%
get_Phrase()-0%100%
get_Children()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.LUIS.Authoring\src\Generated\Models\EntityPrediction.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Collections;
 16    using System.Collections.Generic;
 17    using System.Linq;
 18
 19    /// <summary>
 20    /// A suggested entity.
 21    /// </summary>
 22    public partial class EntityPrediction
 23    {
 24        /// <summary>
 25        /// Initializes a new instance of the EntityPrediction class.
 26        /// </summary>
 027        public EntityPrediction()
 28        {
 29            CustomInit();
 030        }
 31
 32        /// <summary>
 33        /// Initializes a new instance of the EntityPrediction class.
 34        /// </summary>
 35        /// <param name="entityName">The entity's name</param>
 36        /// <param name="startTokenIndex">The index within the utterance where
 37        /// the extracted entity starts.</param>
 38        /// <param name="endTokenIndex">The index within the utterance where
 39        /// the extracted entity ends.</param>
 40        /// <param name="phrase">The actual token(s) that comprise the
 41        /// entity.</param>
 042        public EntityPrediction(string entityName, int startTokenIndex, int endTokenIndex, string phrase, IList<EntityPr
 43        {
 044            EntityName = entityName;
 045            StartTokenIndex = startTokenIndex;
 046            EndTokenIndex = endTokenIndex;
 047            Phrase = phrase;
 048            Children = children;
 49            CustomInit();
 050        }
 51
 52        /// <summary>
 53        /// An initialization method that performs custom operations like setting defaults
 54        /// </summary>
 55        partial void CustomInit();
 56
 57        /// <summary>
 58        /// Gets or sets the entity's name
 59        /// </summary>
 60        [JsonProperty(PropertyName = "entityName")]
 061        public string EntityName { get; set; }
 62
 63        /// <summary>
 64        /// Gets or sets the index within the utterance where the extracted
 65        /// entity starts.
 66        /// </summary>
 67        [JsonProperty(PropertyName = "startTokenIndex")]
 068        public int StartTokenIndex { get; set; }
 69
 70        /// <summary>
 71        /// Gets or sets the index within the utterance where the extracted
 72        /// entity ends.
 73        /// </summary>
 74        [JsonProperty(PropertyName = "endTokenIndex")]
 075        public int EndTokenIndex { get; set; }
 76
 77        /// <summary>
 78        /// Gets or sets the actual token(s) that comprise the entity.
 79        /// </summary>
 80        [JsonProperty(PropertyName = "phrase")]
 081        public string Phrase { get; set; }
 82
 83        /// <summary>
 84        /// </summary>
 85        [JsonProperty(PropertyName = "children")]
 086        public IList<EntityPrediction> Children { get; set; }
 87
 88        /// <summary>
 89        /// Validate the object.
 90        /// </summary>
 91        /// <exception cref="ValidationException">
 92        /// Thrown if validation fails
 93        /// </exception>
 94        public virtual void Validate()
 95        {
 096            if (EntityName == null)
 97            {
 098                throw new ValidationException(ValidationRules.CannotBeNull, "EntityName");
 99            }
 0100            if (Phrase == null)
 101            {
 0102                throw new ValidationException(ValidationRules.CannotBeNull, "Phrase");
 103            }
 0104            if (Children != null)
 105            {
 0106                foreach (var element in Children)
 107                {
 0108                    if (element != null)
 109                    {
 0110                        element.Validate();
 111                    }
 112                }
 113            }
 0114        }
 115    }
 116}