< Summary

Class:Azure.Search.Documents.Indexes.Models.AnalyzeTextOptions
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\AnalyzeTextOptions.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\AnalyzeTextOptions.Serialization.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\AnalyzeTextOptions.cs
Covered lines:22
Uncovered lines:25
Coverable lines:47
Total lines:145
Line coverage:46.8% (22 of 47)
Covered branches:7
Total branches:18
Branch coverage:38.8% (7 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
get_Text()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-47.83%41.67%
.ctor(...)-0%0%
.ctor(...)-100%100%
get_AnalyzerName()-100%100%
get_TokenizerName()-100%100%
get_TokenFilters()-100%100%
get_CharFilters()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\AnalyzeTextOptions.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> Specifies some text and analysis components used to break that text into tokens. </summary>
 15    public partial class AnalyzeTextOptions
 16    {
 17        /// <summary> Initializes a new instance of AnalyzeTextOptions. </summary>
 18        /// <param name="text"> The text to break into tokens. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="text"/> is null. </exception>
 020        public AnalyzeTextOptions(string text)
 21        {
 022            if (text == null)
 23            {
 024                throw new ArgumentNullException(nameof(text));
 25            }
 26
 027            Text = text;
 028            TokenFilters = new ChangeTrackingList<TokenFilterName>();
 029            CharFilters = new ChangeTrackingList<string>();
 030        }
 31
 32        /// <summary> The text to break into tokens. </summary>
 233        public string Text { get; }
 34    }
 35}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\AnalyzeTextOptions.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.Search.Documents.Indexes.Models
 12{
 13    public partial class AnalyzeTextOptions : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 217            writer.WriteStartObject();
 218            writer.WritePropertyName("text");
 219            writer.WriteStringValue(Text);
 220            if (Optional.IsDefined(AnalyzerName))
 21            {
 022                writer.WritePropertyName("analyzer");
 023                writer.WriteStringValue(AnalyzerName.Value.ToString());
 24            }
 225            if (Optional.IsDefined(TokenizerName))
 26            {
 227                writer.WritePropertyName("tokenizer");
 228                writer.WriteStringValue(TokenizerName.Value.ToString());
 29            }
 230            if (Optional.IsCollectionDefined(TokenFilters))
 31            {
 032                writer.WritePropertyName("tokenFilters");
 033                writer.WriteStartArray();
 034                foreach (var item in TokenFilters)
 35                {
 036                    writer.WriteStringValue(item.ToString());
 37                }
 038                writer.WriteEndArray();
 39            }
 240            if (Optional.IsCollectionDefined(CharFilters))
 41            {
 042                writer.WritePropertyName("charFilters");
 043                writer.WriteStartArray();
 044                foreach (var item in CharFilters)
 45                {
 046                    writer.WriteStringValue(item);
 47                }
 048                writer.WriteEndArray();
 49            }
 250            writer.WriteEndObject();
 251        }
 52    }
 53}

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6using Azure.Core;
 7
 8namespace Azure.Search.Documents.Indexes.Models
 9{
 10    [CodeGenModel("AnalyzeRequest")]
 11    public partial class AnalyzeTextOptions
 12    {
 13        /// <summary>
 14        /// Initializes a new instance of AnalyzeRequest.
 15        /// </summary>
 16        /// <param name="text">Required text to break into tokens.</param>
 17        /// <param name="analyzerName">The name of the analyzer to use to break the given <paramref name="text"/>.</para
 18        /// <exception cref="ArgumentNullException"><paramref name="text"/> is null.</exception>
 019        public AnalyzeTextOptions(string text, LexicalAnalyzerName analyzerName)
 20        {
 021            Text = text ?? throw new ArgumentNullException(nameof(text));
 022            AnalyzerName = analyzerName;
 23
 024            TokenFilters = new ChangeTrackingList<TokenFilterName>();
 025            CharFilters = new ChangeTrackingList<string>();
 026        }
 27
 28        /// <summary>
 29        /// Initializes a new instance of AnalyzeRequest.
 30        /// </summary>
 31        /// <param name="text">Required text to break into tokens.</param>
 32        /// <param name="tokenizerName">The name of the tokenizer to use to break the given <paramref name="text"/>.</pa
 33        /// <exception cref="ArgumentNullException"><paramref name="text"/> is null.</exception>
 334        public AnalyzeTextOptions(string text, LexicalTokenizerName tokenizerName)
 35        {
 336            Text = text ?? throw new ArgumentNullException(nameof(text));
 237            TokenizerName = tokenizerName;
 38
 239            TokenFilters = new ChangeTrackingList<TokenFilterName>();
 240            CharFilters = new ChangeTrackingList<string>();
 241        }
 42
 43        /// <summary> The name of the analyzer to use to break the given text. If this parameter is not specified, you m
 44        [CodeGenMember("Analyzer")]
 245        public LexicalAnalyzerName? AnalyzerName { get; }
 46
 47        /// <summary> The name of the tokenizer to use to break the given text. If this parameter is not specified, you 
 48        [CodeGenMember("Tokenizer")]
 449        public LexicalTokenizerName? TokenizerName { get; }
 50
 51        /// <summary> An optional list of token filters to use when breaking the given text. This parameter can only be 
 252        public IList<TokenFilterName> TokenFilters { get; }
 53
 54        /// <summary> An optional list of character filters to use when breaking the given text. This parameter can only
 255        public IList<string> CharFilters { get; }
 56    }
 57}