< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_GenerateWordParts()-0%100%
get_GenerateNumberParts()-0%100%
get_CatenateWords()-0%100%
get_CatenateNumbers()-0%100%
get_CatenateAll()-0%100%
get_SplitOnCaseChange()-0%100%
get_PreserveOriginal()-0%100%
get_SplitOnNumerics()-0%100%
get_StemEnglishPossessive()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeWordDelimiterTokenFilter(...)-0%0%
get_ProtectedWords()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\WordDelimiterTokenFilter.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> Splits words into subwords and performs optional transformations on subword groups. This token filter 
 15    public partial class WordDelimiterTokenFilter : TokenFilter
 16    {
 17        /// <summary> Initializes a new instance of WordDelimiterTokenFilter. </summary>
 18        /// <param name="name"> The name of the token filter. It must only contain letters, digits, spaces, dashes or un
 19        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 020        public WordDelimiterTokenFilter(string name) : base(name)
 21        {
 022            if (name == null)
 23            {
 024                throw new ArgumentNullException(nameof(name));
 25            }
 26
 027            ProtectedWords = new ChangeTrackingList<string>();
 028            ODataType = "#Microsoft.Azure.Search.WordDelimiterTokenFilter";
 029        }
 30
 31        /// <summary> Initializes a new instance of WordDelimiterTokenFilter. </summary>
 32        /// <param name="oDataType"> Identifies the concrete type of the token filter. </param>
 33        /// <param name="name"> The name of the token filter. It must only contain letters, digits, spaces, dashes or un
 34        /// <param name="generateWordParts"> A value indicating whether to generate part words. If set, causes parts of 
 35        /// <param name="generateNumberParts"> A value indicating whether to generate number subwords. Default is true. 
 36        /// <param name="catenateWords"> A value indicating whether maximum runs of word parts will be catenated. For ex
 37        /// <param name="catenateNumbers"> A value indicating whether maximum runs of number parts will be catenated. Fo
 38        /// <param name="catenateAll"> A value indicating whether all subword parts will be catenated. For example, if t
 39        /// <param name="splitOnCaseChange"> A value indicating whether to split words on caseChange. For example, if th
 40        /// <param name="preserveOriginal"> A value indicating whether original words will be preserved and added to the
 41        /// <param name="splitOnNumerics"> A value indicating whether to split on numbers. For example, if this is set t
 42        /// <param name="stemEnglishPossessive"> A value indicating whether to remove trailing &quot;&apos;s&quot; for e
 43        /// <param name="protectedWords"> A list of tokens to protect from being delimited. </param>
 044        internal WordDelimiterTokenFilter(string oDataType, string name, bool? generateWordParts, bool? generateNumberPa
 45        {
 046            GenerateWordParts = generateWordParts;
 047            GenerateNumberParts = generateNumberParts;
 048            CatenateWords = catenateWords;
 049            CatenateNumbers = catenateNumbers;
 050            CatenateAll = catenateAll;
 051            SplitOnCaseChange = splitOnCaseChange;
 052            PreserveOriginal = preserveOriginal;
 053            SplitOnNumerics = splitOnNumerics;
 054            StemEnglishPossessive = stemEnglishPossessive;
 055            ProtectedWords = protectedWords;
 056            ODataType = oDataType ?? "#Microsoft.Azure.Search.WordDelimiterTokenFilter";
 057        }
 58
 59        /// <summary> A value indicating whether to generate part words. If set, causes parts of words to be generated; 
 060        public bool? GenerateWordParts { get; set; }
 61        /// <summary> A value indicating whether to generate number subwords. Default is true. </summary>
 062        public bool? GenerateNumberParts { get; set; }
 63        /// <summary> A value indicating whether maximum runs of word parts will be catenated. For example, if this is s
 064        public bool? CatenateWords { get; set; }
 65        /// <summary> A value indicating whether maximum runs of number parts will be catenated. For example, if this is
 066        public bool? CatenateNumbers { get; set; }
 67        /// <summary> A value indicating whether all subword parts will be catenated. For example, if this is set to tru
 068        public bool? CatenateAll { get; set; }
 69        /// <summary> A value indicating whether to split words on caseChange. For example, if this is set to true, &quo
 070        public bool? SplitOnCaseChange { get; set; }
 71        /// <summary> A value indicating whether original words will be preserved and added to the subword list. Default
 072        public bool? PreserveOriginal { get; set; }
 73        /// <summary> A value indicating whether to split on numbers. For example, if this is set to true, &quot;Azure1S
 074        public bool? SplitOnNumerics { get; set; }
 75        /// <summary> A value indicating whether to remove trailing &quot;&apos;s&quot; for each subword. Default is tru
 076        public bool? StemEnglishPossessive { get; set; }
 77    }
 78}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\WordDelimiterTokenFilter.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 WordDelimiterTokenFilter : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsDefined(GenerateWordParts))
 20            {
 021                writer.WritePropertyName("generateWordParts");
 022                writer.WriteBooleanValue(GenerateWordParts.Value);
 23            }
 024            if (Optional.IsDefined(GenerateNumberParts))
 25            {
 026                writer.WritePropertyName("generateNumberParts");
 027                writer.WriteBooleanValue(GenerateNumberParts.Value);
 28            }
 029            if (Optional.IsDefined(CatenateWords))
 30            {
 031                writer.WritePropertyName("catenateWords");
 032                writer.WriteBooleanValue(CatenateWords.Value);
 33            }
 034            if (Optional.IsDefined(CatenateNumbers))
 35            {
 036                writer.WritePropertyName("catenateNumbers");
 037                writer.WriteBooleanValue(CatenateNumbers.Value);
 38            }
 039            if (Optional.IsDefined(CatenateAll))
 40            {
 041                writer.WritePropertyName("catenateAll");
 042                writer.WriteBooleanValue(CatenateAll.Value);
 43            }
 044            if (Optional.IsDefined(SplitOnCaseChange))
 45            {
 046                writer.WritePropertyName("splitOnCaseChange");
 047                writer.WriteBooleanValue(SplitOnCaseChange.Value);
 48            }
 049            if (Optional.IsDefined(PreserveOriginal))
 50            {
 051                writer.WritePropertyName("preserveOriginal");
 052                writer.WriteBooleanValue(PreserveOriginal.Value);
 53            }
 054            if (Optional.IsDefined(SplitOnNumerics))
 55            {
 056                writer.WritePropertyName("splitOnNumerics");
 057                writer.WriteBooleanValue(SplitOnNumerics.Value);
 58            }
 059            if (Optional.IsDefined(StemEnglishPossessive))
 60            {
 061                writer.WritePropertyName("stemEnglishPossessive");
 062                writer.WriteBooleanValue(StemEnglishPossessive.Value);
 63            }
 064            if (Optional.IsCollectionDefined(ProtectedWords))
 65            {
 066                writer.WritePropertyName("protectedWords");
 067                writer.WriteStartArray();
 068                foreach (var item in ProtectedWords)
 69                {
 070                    writer.WriteStringValue(item);
 71                }
 072                writer.WriteEndArray();
 73            }
 074            writer.WritePropertyName("@odata.type");
 075            writer.WriteStringValue(ODataType);
 076            writer.WritePropertyName("name");
 077            writer.WriteStringValue(Name);
 078            writer.WriteEndObject();
 079        }
 80
 81        internal static WordDelimiterTokenFilter DeserializeWordDelimiterTokenFilter(JsonElement element)
 82        {
 083            Optional<bool> generateWordParts = default;
 084            Optional<bool> generateNumberParts = default;
 085            Optional<bool> catenateWords = default;
 086            Optional<bool> catenateNumbers = default;
 087            Optional<bool> catenateAll = default;
 088            Optional<bool> splitOnCaseChange = default;
 089            Optional<bool> preserveOriginal = default;
 090            Optional<bool> splitOnNumerics = default;
 091            Optional<bool> stemEnglishPossessive = default;
 092            Optional<IList<string>> protectedWords = default;
 093            string odataType = default;
 094            string name = default;
 095            foreach (var property in element.EnumerateObject())
 96            {
 097                if (property.NameEquals("generateWordParts"))
 98                {
 099                    generateWordParts = property.Value.GetBoolean();
 0100                    continue;
 101                }
 0102                if (property.NameEquals("generateNumberParts"))
 103                {
 0104                    generateNumberParts = property.Value.GetBoolean();
 0105                    continue;
 106                }
 0107                if (property.NameEquals("catenateWords"))
 108                {
 0109                    catenateWords = property.Value.GetBoolean();
 0110                    continue;
 111                }
 0112                if (property.NameEquals("catenateNumbers"))
 113                {
 0114                    catenateNumbers = property.Value.GetBoolean();
 0115                    continue;
 116                }
 0117                if (property.NameEquals("catenateAll"))
 118                {
 0119                    catenateAll = property.Value.GetBoolean();
 0120                    continue;
 121                }
 0122                if (property.NameEquals("splitOnCaseChange"))
 123                {
 0124                    splitOnCaseChange = property.Value.GetBoolean();
 0125                    continue;
 126                }
 0127                if (property.NameEquals("preserveOriginal"))
 128                {
 0129                    preserveOriginal = property.Value.GetBoolean();
 0130                    continue;
 131                }
 0132                if (property.NameEquals("splitOnNumerics"))
 133                {
 0134                    splitOnNumerics = property.Value.GetBoolean();
 0135                    continue;
 136                }
 0137                if (property.NameEquals("stemEnglishPossessive"))
 138                {
 0139                    stemEnglishPossessive = property.Value.GetBoolean();
 0140                    continue;
 141                }
 0142                if (property.NameEquals("protectedWords"))
 143                {
 0144                    List<string> array = new List<string>();
 0145                    foreach (var item in property.Value.EnumerateArray())
 146                    {
 0147                        array.Add(item.GetString());
 148                    }
 0149                    protectedWords = array;
 0150                    continue;
 151                }
 0152                if (property.NameEquals("@odata.type"))
 153                {
 0154                    odataType = property.Value.GetString();
 0155                    continue;
 156                }
 0157                if (property.NameEquals("name"))
 158                {
 0159                    name = property.Value.GetString();
 160                    continue;
 161                }
 162            }
 0163            return new WordDelimiterTokenFilter(odataType, name, Optional.ToNullable(generateWordParts), Optional.ToNull
 164        }
 165    }
 166}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\WordDelimiterTokenFilter.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 WordDelimiterTokenFilter
 10    {
 11        /// <summary> A list of tokens to protect from being delimited. </summary>
 012        public IList<string> ProtectedWords { get; }
 13    }
 14}