| | 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.Linq; |
| | 16 | |
|
| | 17 | | /// <summary> |
| | 18 | | /// Divides text using language-specific rules. |
| | 19 | | /// </summary> |
| | 20 | | [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.MicrosoftLanguageTokenizer")] |
| | 21 | | public partial class MicrosoftLanguageTokenizer : Tokenizer |
| | 22 | | { |
| | 23 | | /// <summary> |
| | 24 | | /// Initializes a new instance of the MicrosoftLanguageTokenizer class. |
| | 25 | | /// </summary> |
| 88 | 26 | | public MicrosoftLanguageTokenizer() |
| | 27 | | { |
| | 28 | | CustomInit(); |
| 88 | 29 | | } |
| | 30 | |
|
| | 31 | | /// <summary> |
| | 32 | | /// Initializes a new instance of the MicrosoftLanguageTokenizer class. |
| | 33 | | /// </summary> |
| | 34 | | /// <param name="name">The name of the tokenizer. It must only contain |
| | 35 | | /// letters, digits, spaces, dashes or underscores, can only start and |
| | 36 | | /// end with alphanumeric characters, and is limited to 128 |
| | 37 | | /// characters.</param> |
| | 38 | | /// <param name="maxTokenLength">The maximum token length. Tokens |
| | 39 | | /// longer than the maximum length are split. Maximum token length that |
| | 40 | | /// can be used is 300 characters. Tokens longer than 300 characters |
| | 41 | | /// are first split into tokens of length 300 and then each of those |
| | 42 | | /// tokens is split based on the max token length set. Default is |
| | 43 | | /// 255.</param> |
| | 44 | | /// <param name="isSearchTokenizer">A value indicating how the |
| | 45 | | /// tokenizer is used. Set to true if used as the search tokenizer, set |
| | 46 | | /// to false if used as the indexing tokenizer. Default is |
| | 47 | | /// false.</param> |
| | 48 | | /// <param name="language">The language to use. The default is English. |
| | 49 | | /// Possible values include: 'bangla', 'bulgarian', 'catalan', |
| | 50 | | /// 'chineseSimplified', 'chineseTraditional', 'croatian', 'czech', |
| | 51 | | /// 'danish', 'dutch', 'english', 'french', 'german', 'greek', |
| | 52 | | /// 'gujarati', 'hindi', 'icelandic', 'indonesian', 'italian', |
| | 53 | | /// 'japanese', 'kannada', 'korean', 'malay', 'malayalam', 'marathi', |
| | 54 | | /// 'norwegianBokmaal', 'polish', 'portuguese', 'portugueseBrazilian', |
| | 55 | | /// 'punjabi', 'romanian', 'russian', 'serbianCyrillic', |
| | 56 | | /// 'serbianLatin', 'slovenian', 'spanish', 'swedish', 'tamil', |
| | 57 | | /// 'telugu', 'thai', 'ukrainian', 'urdu', 'vietnamese'</param> |
| | 58 | | public MicrosoftLanguageTokenizer(string name, int? maxTokenLength = default(int?), bool? isSearchTokenizer = de |
| 90 | 59 | | : base(name) |
| | 60 | | { |
| 90 | 61 | | MaxTokenLength = maxTokenLength; |
| 90 | 62 | | IsSearchTokenizer = isSearchTokenizer; |
| 90 | 63 | | Language = language; |
| | 64 | | CustomInit(); |
| 90 | 65 | | } |
| | 66 | |
|
| | 67 | | /// <summary> |
| | 68 | | /// An initialization method that performs custom operations like setting defaults |
| | 69 | | /// </summary> |
| | 70 | | partial void CustomInit(); |
| | 71 | |
|
| | 72 | | /// <summary> |
| | 73 | | /// Gets or sets the maximum token length. Tokens longer than the |
| | 74 | | /// maximum length are split. Maximum token length that can be used is |
| | 75 | | /// 300 characters. Tokens longer than 300 characters are first split |
| | 76 | | /// into tokens of length 300 and then each of those tokens is split |
| | 77 | | /// based on the max token length set. Default is 255. |
| | 78 | | /// </summary> |
| | 79 | | [JsonProperty(PropertyName = "maxTokenLength")] |
| 530 | 80 | | public int? MaxTokenLength { get; set; } |
| | 81 | |
|
| | 82 | | /// <summary> |
| | 83 | | /// Gets or sets a value indicating how the tokenizer is used. Set to |
| | 84 | | /// true if used as the search tokenizer, set to false if used as the |
| | 85 | | /// indexing tokenizer. Default is false. |
| | 86 | | /// </summary> |
| | 87 | | [JsonProperty(PropertyName = "isSearchTokenizer")] |
| 442 | 88 | | public bool? IsSearchTokenizer { get; set; } |
| | 89 | |
|
| | 90 | | /// <summary> |
| | 91 | | /// Gets or sets the language to use. The default is English. Possible |
| | 92 | | /// values include: 'bangla', 'bulgarian', 'catalan', |
| | 93 | | /// 'chineseSimplified', 'chineseTraditional', 'croatian', 'czech', |
| | 94 | | /// 'danish', 'dutch', 'english', 'french', 'german', 'greek', |
| | 95 | | /// 'gujarati', 'hindi', 'icelandic', 'indonesian', 'italian', |
| | 96 | | /// 'japanese', 'kannada', 'korean', 'malay', 'malayalam', 'marathi', |
| | 97 | | /// 'norwegianBokmaal', 'polish', 'portuguese', 'portugueseBrazilian', |
| | 98 | | /// 'punjabi', 'romanian', 'russian', 'serbianCyrillic', |
| | 99 | | /// 'serbianLatin', 'slovenian', 'spanish', 'swedish', 'tamil', |
| | 100 | | /// 'telugu', 'thai', 'ukrainian', 'urdu', 'vietnamese' |
| | 101 | | /// </summary> |
| | 102 | | [JsonProperty(PropertyName = "language")] |
| 442 | 103 | | public MicrosoftTokenizerLanguage? Language { get; set; } |
| | 104 | |
|
| | 105 | | /// <summary> |
| | 106 | | /// Validate the object. |
| | 107 | | /// </summary> |
| | 108 | | /// <exception cref="ValidationException"> |
| | 109 | | /// Thrown if validation fails |
| | 110 | | /// </exception> |
| | 111 | | public override void Validate() |
| | 112 | | { |
| 88 | 113 | | base.Validate(); |
| 88 | 114 | | if (MaxTokenLength > 300) |
| | 115 | | { |
| 0 | 116 | | throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxTokenLength", 300); |
| | 117 | | } |
| 88 | 118 | | } |
| | 119 | | } |
| | 120 | | } |