| | 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 | |
|
| | 11 | | namespace Microsoft.Azure.Search.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 | | /// Specifies some text and analysis components used to break that text |
| | 21 | | /// into tokens. |
| | 22 | | /// </summary> |
| | 23 | | public partial class AnalyzeRequest |
| | 24 | | { |
| | 25 | | /// <summary> |
| | 26 | | /// Initializes a new instance of the AnalyzeRequest class. |
| | 27 | | /// </summary> |
| 216 | 28 | | public AnalyzeRequest() |
| | 29 | | { |
| | 30 | | CustomInit(); |
| 216 | 31 | | } |
| | 32 | |
|
| | 33 | | /// <summary> |
| | 34 | | /// Initializes a new instance of the AnalyzeRequest class. |
| | 35 | | /// </summary> |
| | 36 | | /// <param name="text">The text to break into tokens.</param> |
| | 37 | | /// <param name="analyzer">The name of the analyzer to use to break the |
| | 38 | | /// given text. If this parameter is not specified, you must specify a |
| | 39 | | /// tokenizer instead. The tokenizer and analyzer parameters are |
| | 40 | | /// mutually exclusive. Possible values include: 'ar.microsoft', |
| | 41 | | /// 'ar.lucene', 'hy.lucene', 'bn.microsoft', 'eu.lucene', |
| | 42 | | /// 'bg.microsoft', 'bg.lucene', 'ca.microsoft', 'ca.lucene', |
| | 43 | | /// 'zh-Hans.microsoft', 'zh-Hans.lucene', 'zh-Hant.microsoft', |
| | 44 | | /// 'zh-Hant.lucene', 'hr.microsoft', 'cs.microsoft', 'cs.lucene', |
| | 45 | | /// 'da.microsoft', 'da.lucene', 'nl.microsoft', 'nl.lucene', |
| | 46 | | /// 'en.microsoft', 'en.lucene', 'et.microsoft', 'fi.microsoft', |
| | 47 | | /// 'fi.lucene', 'fr.microsoft', 'fr.lucene', 'gl.lucene', |
| | 48 | | /// 'de.microsoft', 'de.lucene', 'el.microsoft', 'el.lucene', |
| | 49 | | /// 'gu.microsoft', 'he.microsoft', 'hi.microsoft', 'hi.lucene', |
| | 50 | | /// 'hu.microsoft', 'hu.lucene', 'is.microsoft', 'id.microsoft', |
| | 51 | | /// 'id.lucene', 'ga.lucene', 'it.microsoft', 'it.lucene', |
| | 52 | | /// 'ja.microsoft', 'ja.lucene', 'kn.microsoft', 'ko.microsoft', |
| | 53 | | /// 'ko.lucene', 'lv.microsoft', 'lv.lucene', 'lt.microsoft', |
| | 54 | | /// 'ml.microsoft', 'ms.microsoft', 'mr.microsoft', 'nb.microsoft', |
| | 55 | | /// 'no.lucene', 'fa.lucene', 'pl.microsoft', 'pl.lucene', |
| | 56 | | /// 'pt-BR.microsoft', 'pt-BR.lucene', 'pt-PT.microsoft', |
| | 57 | | /// 'pt-PT.lucene', 'pa.microsoft', 'ro.microsoft', 'ro.lucene', |
| | 58 | | /// 'ru.microsoft', 'ru.lucene', 'sr-cyrillic.microsoft', |
| | 59 | | /// 'sr-latin.microsoft', 'sk.microsoft', 'sl.microsoft', |
| | 60 | | /// 'es.microsoft', 'es.lucene', 'sv.microsoft', 'sv.lucene', |
| | 61 | | /// 'ta.microsoft', 'te.microsoft', 'th.microsoft', 'th.lucene', |
| | 62 | | /// 'tr.microsoft', 'tr.lucene', 'uk.microsoft', 'ur.microsoft', |
| | 63 | | /// 'vi.microsoft', 'standard.lucene', 'standardasciifolding.lucene', |
| | 64 | | /// 'keyword', 'pattern', 'simple', 'stop', 'whitespace'</param> |
| | 65 | | /// <param name="tokenizer">The name of the tokenizer to use to break |
| | 66 | | /// the given text. If this parameter is not specified, you must |
| | 67 | | /// specify an analyzer instead. The tokenizer and analyzer parameters |
| | 68 | | /// are mutually exclusive. Possible values include: 'classic', |
| | 69 | | /// 'edgeNGram', 'keyword_v2', 'letter', 'lowercase', |
| | 70 | | /// 'microsoft_language_tokenizer', |
| | 71 | | /// 'microsoft_language_stemming_tokenizer', 'nGram', |
| | 72 | | /// 'path_hierarchy_v2', 'pattern', 'standard_v2', 'uax_url_email', |
| | 73 | | /// 'whitespace'</param> |
| | 74 | | /// <param name="tokenFilters">An optional list of token filters to use |
| | 75 | | /// when breaking the given text. This parameter can only be set when |
| | 76 | | /// using the tokenizer parameter.</param> |
| | 77 | | /// <param name="charFilters">An optional list of character filters to |
| | 78 | | /// use when breaking the given text. This parameter can only be set |
| | 79 | | /// when using the tokenizer parameter.</param> |
| 2 | 80 | | public AnalyzeRequest(string text, AnalyzerName? analyzer = default(AnalyzerName?), TokenizerName? tokenizer = d |
| | 81 | | { |
| 2 | 82 | | Text = text; |
| 2 | 83 | | Analyzer = analyzer; |
| 2 | 84 | | Tokenizer = tokenizer; |
| 2 | 85 | | TokenFilters = tokenFilters; |
| 2 | 86 | | CharFilters = charFilters; |
| | 87 | | CustomInit(); |
| 2 | 88 | | } |
| | 89 | |
|
| | 90 | | /// <summary> |
| | 91 | | /// An initialization method that performs custom operations like setting defaults |
| | 92 | | /// </summary> |
| | 93 | | partial void CustomInit(); |
| | 94 | |
|
| | 95 | | /// <summary> |
| | 96 | | /// Gets or sets the text to break into tokens. |
| | 97 | | /// </summary> |
| | 98 | | [JsonProperty(PropertyName = "text")] |
| 654 | 99 | | public string Text { get; set; } |
| | 100 | |
|
| | 101 | | /// <summary> |
| | 102 | | /// Gets or sets the name of the analyzer to use to break the given |
| | 103 | | /// text. If this parameter is not specified, you must specify a |
| | 104 | | /// tokenizer instead. The tokenizer and analyzer parameters are |
| | 105 | | /// mutually exclusive. Possible values include: 'ar.microsoft', |
| | 106 | | /// 'ar.lucene', 'hy.lucene', 'bn.microsoft', 'eu.lucene', |
| | 107 | | /// 'bg.microsoft', 'bg.lucene', 'ca.microsoft', 'ca.lucene', |
| | 108 | | /// 'zh-Hans.microsoft', 'zh-Hans.lucene', 'zh-Hant.microsoft', |
| | 109 | | /// 'zh-Hant.lucene', 'hr.microsoft', 'cs.microsoft', 'cs.lucene', |
| | 110 | | /// 'da.microsoft', 'da.lucene', 'nl.microsoft', 'nl.lucene', |
| | 111 | | /// 'en.microsoft', 'en.lucene', 'et.microsoft', 'fi.microsoft', |
| | 112 | | /// 'fi.lucene', 'fr.microsoft', 'fr.lucene', 'gl.lucene', |
| | 113 | | /// 'de.microsoft', 'de.lucene', 'el.microsoft', 'el.lucene', |
| | 114 | | /// 'gu.microsoft', 'he.microsoft', 'hi.microsoft', 'hi.lucene', |
| | 115 | | /// 'hu.microsoft', 'hu.lucene', 'is.microsoft', 'id.microsoft', |
| | 116 | | /// 'id.lucene', 'ga.lucene', 'it.microsoft', 'it.lucene', |
| | 117 | | /// 'ja.microsoft', 'ja.lucene', 'kn.microsoft', 'ko.microsoft', |
| | 118 | | /// 'ko.lucene', 'lv.microsoft', 'lv.lucene', 'lt.microsoft', |
| | 119 | | /// 'ml.microsoft', 'ms.microsoft', 'mr.microsoft', 'nb.microsoft', |
| | 120 | | /// 'no.lucene', 'fa.lucene', 'pl.microsoft', 'pl.lucene', |
| | 121 | | /// 'pt-BR.microsoft', 'pt-BR.lucene', 'pt-PT.microsoft', |
| | 122 | | /// 'pt-PT.lucene', 'pa.microsoft', 'ro.microsoft', 'ro.lucene', |
| | 123 | | /// 'ru.microsoft', 'ru.lucene', 'sr-cyrillic.microsoft', |
| | 124 | | /// 'sr-latin.microsoft', 'sk.microsoft', 'sl.microsoft', |
| | 125 | | /// 'es.microsoft', 'es.lucene', 'sv.microsoft', 'sv.lucene', |
| | 126 | | /// 'ta.microsoft', 'te.microsoft', 'th.microsoft', 'th.lucene', |
| | 127 | | /// 'tr.microsoft', 'tr.lucene', 'uk.microsoft', 'ur.microsoft', |
| | 128 | | /// 'vi.microsoft', 'standard.lucene', 'standardasciifolding.lucene', |
| | 129 | | /// 'keyword', 'pattern', 'simple', 'stop', 'whitespace' |
| | 130 | | /// </summary> |
| | 131 | | [JsonProperty(PropertyName = "analyzer")] |
| 408 | 132 | | public AnalyzerName? Analyzer { get; set; } |
| | 133 | |
|
| | 134 | | /// <summary> |
| | 135 | | /// Gets or sets the name of the tokenizer to use to break the given |
| | 136 | | /// text. If this parameter is not specified, you must specify an |
| | 137 | | /// analyzer instead. The tokenizer and analyzer parameters are |
| | 138 | | /// mutually exclusive. Possible values include: 'classic', |
| | 139 | | /// 'edgeNGram', 'keyword_v2', 'letter', 'lowercase', |
| | 140 | | /// 'microsoft_language_tokenizer', |
| | 141 | | /// 'microsoft_language_stemming_tokenizer', 'nGram', |
| | 142 | | /// 'path_hierarchy_v2', 'pattern', 'standard_v2', 'uax_url_email', |
| | 143 | | /// 'whitespace' |
| | 144 | | /// </summary> |
| | 145 | | [JsonProperty(PropertyName = "tokenizer")] |
| 248 | 146 | | public TokenizerName? Tokenizer { get; set; } |
| | 147 | |
|
| | 148 | | /// <summary> |
| | 149 | | /// Gets or sets an optional list of token filters to use when breaking |
| | 150 | | /// the given text. This parameter can only be set when using the |
| | 151 | | /// tokenizer parameter. |
| | 152 | | /// </summary> |
| | 153 | | [JsonProperty(PropertyName = "tokenFilters")] |
| 222 | 154 | | public IList<TokenFilterName> TokenFilters { get; set; } |
| | 155 | |
|
| | 156 | | /// <summary> |
| | 157 | | /// Gets or sets an optional list of character filters to use when |
| | 158 | | /// breaking the given text. This parameter can only be set when using |
| | 159 | | /// the tokenizer parameter. |
| | 160 | | /// </summary> |
| | 161 | | [JsonProperty(PropertyName = "charFilters")] |
| 222 | 162 | | public IList<CharFilterName> CharFilters { get; set; } |
| | 163 | |
|
| | 164 | | /// <summary> |
| | 165 | | /// Validate the object. |
| | 166 | | /// </summary> |
| | 167 | | /// <exception cref="ValidationException"> |
| | 168 | | /// Thrown if validation fails |
| | 169 | | /// </exception> |
| | 170 | | public virtual void Validate() |
| | 171 | | { |
| 218 | 172 | | if (Text == null) |
| | 173 | | { |
| 0 | 174 | | throw new ValidationException(ValidationRules.CannotBeNull, "Text"); |
| | 175 | | } |
| 218 | 176 | | } |
| | 177 | | } |
| | 178 | | } |