| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using System.Collections.Generic; |
| | 6 | | using Azure.Core; |
| | 7 | |
|
| | 8 | | namespace 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> |
| 0 | 19 | | public AnalyzeTextOptions(string text, LexicalAnalyzerName analyzerName) |
| | 20 | | { |
| 0 | 21 | | Text = text ?? throw new ArgumentNullException(nameof(text)); |
| 0 | 22 | | AnalyzerName = analyzerName; |
| | 23 | |
|
| 0 | 24 | | TokenFilters = new ChangeTrackingList<TokenFilterName>(); |
| 0 | 25 | | CharFilters = new ChangeTrackingList<string>(); |
| 0 | 26 | | } |
| | 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> |
| 3 | 34 | | public AnalyzeTextOptions(string text, LexicalTokenizerName tokenizerName) |
| | 35 | | { |
| 3 | 36 | | Text = text ?? throw new ArgumentNullException(nameof(text)); |
| 2 | 37 | | TokenizerName = tokenizerName; |
| | 38 | |
|
| 2 | 39 | | TokenFilters = new ChangeTrackingList<TokenFilterName>(); |
| 2 | 40 | | CharFilters = new ChangeTrackingList<string>(); |
| 2 | 41 | | } |
| | 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")] |
| 2 | 45 | | 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")] |
| 4 | 49 | | 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 |
| 2 | 52 | | 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 |
| 2 | 55 | | public IList<string> CharFilters { get; } |
| | 56 | | } |
| | 57 | | } |