| | 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 | | /// Breaks text following the Unicode Text Segmentation rules. This |
| | 19 | | /// tokenizer is implemented using Apache Lucene. |
| | 20 | | /// <see |
| | 21 | | /// href="http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/StandardTokenize |
| | 22 | | /// /> |
| | 23 | | /// </summary> |
| | 24 | | [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.StandardTokenizerV2")] |
| | 25 | | public partial class StandardTokenizerV2 : Tokenizer |
| | 26 | | { |
| | 27 | | /// <summary> |
| | 28 | | /// Initializes a new instance of the StandardTokenizerV2 class. |
| | 29 | | /// </summary> |
| 4 | 30 | | public StandardTokenizerV2() |
| | 31 | | { |
| | 32 | | CustomInit(); |
| 4 | 33 | | } |
| | 34 | |
|
| | 35 | | /// <summary> |
| | 36 | | /// Initializes a new instance of the StandardTokenizerV2 class. |
| | 37 | | /// </summary> |
| | 38 | | /// <param name="name">The name of the tokenizer. It must only contain |
| | 39 | | /// letters, digits, spaces, dashes or underscores, can only start and |
| | 40 | | /// end with alphanumeric characters, and is limited to 128 |
| | 41 | | /// characters.</param> |
| | 42 | | /// <param name="maxTokenLength">The maximum token length. Default is |
| | 43 | | /// 255. Tokens longer than the maximum length are split. The maximum |
| | 44 | | /// token length that can be used is 300 characters.</param> |
| | 45 | | public StandardTokenizerV2(string name, int? maxTokenLength = default(int?)) |
| 6 | 46 | | : base(name) |
| | 47 | | { |
| 6 | 48 | | MaxTokenLength = maxTokenLength; |
| | 49 | | CustomInit(); |
| 6 | 50 | | } |
| | 51 | |
|
| | 52 | | /// <summary> |
| | 53 | | /// An initialization method that performs custom operations like setting defaults |
| | 54 | | /// </summary> |
| | 55 | | partial void CustomInit(); |
| | 56 | |
|
| | 57 | | /// <summary> |
| | 58 | | /// Gets or sets the maximum token length. Default is 255. Tokens |
| | 59 | | /// longer than the maximum length are split. The maximum token length |
| | 60 | | /// that can be used is 300 characters. |
| | 61 | | /// </summary> |
| | 62 | | [JsonProperty(PropertyName = "maxTokenLength")] |
| 26 | 63 | | public int? MaxTokenLength { get; set; } |
| | 64 | |
|
| | 65 | | /// <summary> |
| | 66 | | /// Validate the object. |
| | 67 | | /// </summary> |
| | 68 | | /// <exception cref="ValidationException"> |
| | 69 | | /// Thrown if validation fails |
| | 70 | | /// </exception> |
| | 71 | | public override void Validate() |
| | 72 | | { |
| 4 | 73 | | base.Validate(); |
| 4 | 74 | | if (MaxTokenLength > 300) |
| | 75 | | { |
| 0 | 76 | | throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxTokenLength", 300); |
| | 77 | | } |
| 4 | 78 | | } |
| | 79 | | } |
| | 80 | | } |