< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeStemmerOverrideTokenFilter(...)-0%0%
get_Rules()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\StemmerOverrideTokenFilter.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 System.Linq;
 11
 12namespace Azure.Search.Documents.Indexes.Models
 13{
 14    /// <summary> Provides the ability to override other stemming filters with custom dictionary-based stemming. Any dic
 15    public partial class StemmerOverrideTokenFilter : TokenFilter
 16    {
 17        /// <summary> Initializes a new instance of StemmerOverrideTokenFilter. </summary>
 18        /// <param name="name"> The name of the token filter. It must only contain letters, digits, spaces, dashes or un
 19        /// <param name="rules"> A list of stemming rules in the following format: &quot;word =&gt; stem&quot;, for exam
 20        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="rules"/> is null. </exce
 021        public StemmerOverrideTokenFilter(string name, IEnumerable<string> rules) : base(name)
 22        {
 023            if (name == null)
 24            {
 025                throw new ArgumentNullException(nameof(name));
 26            }
 027            if (rules == null)
 28            {
 029                throw new ArgumentNullException(nameof(rules));
 30            }
 31
 032            Rules = rules.ToList();
 033            ODataType = "#Microsoft.Azure.Search.StemmerOverrideTokenFilter";
 034        }
 35
 36        /// <summary> Initializes a new instance of StemmerOverrideTokenFilter. </summary>
 37        /// <param name="oDataType"> Identifies the concrete type of the token filter. </param>
 38        /// <param name="name"> The name of the token filter. It must only contain letters, digits, spaces, dashes or un
 39        /// <param name="rules"> A list of stemming rules in the following format: &quot;word =&gt; stem&quot;, for exam
 040        internal StemmerOverrideTokenFilter(string oDataType, string name, IList<string> rules) : base(oDataType, name)
 41        {
 042            Rules = rules;
 043            ODataType = oDataType ?? "#Microsoft.Azure.Search.StemmerOverrideTokenFilter";
 044        }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\StemmerOverrideTokenFilter.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 StemmerOverrideTokenFilter : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("rules");
 020            writer.WriteStartArray();
 021            foreach (var item in Rules)
 22            {
 023                writer.WriteStringValue(item);
 24            }
 025            writer.WriteEndArray();
 026            writer.WritePropertyName("@odata.type");
 027            writer.WriteStringValue(ODataType);
 028            writer.WritePropertyName("name");
 029            writer.WriteStringValue(Name);
 030            writer.WriteEndObject();
 031        }
 32
 33        internal static StemmerOverrideTokenFilter DeserializeStemmerOverrideTokenFilter(JsonElement element)
 34        {
 035            IList<string> rules = default;
 036            string odataType = default;
 037            string name = default;
 038            foreach (var property in element.EnumerateObject())
 39            {
 040                if (property.NameEquals("rules"))
 41                {
 042                    List<string> array = new List<string>();
 043                    foreach (var item in property.Value.EnumerateArray())
 44                    {
 045                        array.Add(item.GetString());
 46                    }
 047                    rules = array;
 048                    continue;
 49                }
 050                if (property.NameEquals("@odata.type"))
 51                {
 052                    odataType = property.Value.GetString();
 053                    continue;
 54                }
 055                if (property.NameEquals("name"))
 56                {
 057                    name = property.Value.GetString();
 58                    continue;
 59                }
 60            }
 061            return new StemmerOverrideTokenFilter(odataType, name, rules);
 62        }
 63    }
 64}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\StemmerOverrideTokenFilter.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 StemmerOverrideTokenFilter
 10    {
 11        /// <summary> A list of stemming rules in the following format: &quot;word =&gt; stem&quot;, for example: &quot;
 012        public IList<string> Rules { get; }
 13    }
 14}