| | 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 | | /// Provides the ability to override other stemming filters with custom |
| | 21 | | /// dictionary-based stemming. Any dictionary-stemmed terms will be marked |
| | 22 | | /// as keywords so that they will not be stemmed with stemmers down the |
| | 23 | | /// chain. Must be placed before any stemming filters. This token filter is |
| | 24 | | /// implemented using Apache Lucene. |
| | 25 | | /// <see |
| | 26 | | /// href="http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/StemmerOver |
| | 27 | | /// /> |
| | 28 | | /// </summary> |
| | 29 | | [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.StemmerOverrideTokenFilter")] |
| | 30 | | public partial class StemmerOverrideTokenFilter : TokenFilter |
| | 31 | | { |
| | 32 | | /// <summary> |
| | 33 | | /// Initializes a new instance of the StemmerOverrideTokenFilter class. |
| | 34 | | /// </summary> |
| 2 | 35 | | public StemmerOverrideTokenFilter() |
| | 36 | | { |
| | 37 | | CustomInit(); |
| 2 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> |
| | 41 | | /// Initializes a new instance of the StemmerOverrideTokenFilter class. |
| | 42 | | /// </summary> |
| | 43 | | /// <param name="name">The name of the token filter. It must only |
| | 44 | | /// contain letters, digits, spaces, dashes or underscores, can only |
| | 45 | | /// start and end with alphanumeric characters, and is limited to 128 |
| | 46 | | /// characters.</param> |
| | 47 | | /// <param name="rules">A list of stemming rules in the following |
| | 48 | | /// format: "word => stem", for example: "ran => run".</param> |
| | 49 | | public StemmerOverrideTokenFilter(string name, IList<string> rules) |
| 2 | 50 | | : base(name) |
| | 51 | | { |
| 2 | 52 | | Rules = rules; |
| | 53 | | CustomInit(); |
| 2 | 54 | | } |
| | 55 | |
|
| | 56 | | /// <summary> |
| | 57 | | /// An initialization method that performs custom operations like setting defaults |
| | 58 | | /// </summary> |
| | 59 | | partial void CustomInit(); |
| | 60 | |
|
| | 61 | | /// <summary> |
| | 62 | | /// Gets or sets a list of stemming rules in the following format: |
| | 63 | | /// "word =&gt; stem", for example: "ran =&gt; run". |
| | 64 | | /// </summary> |
| | 65 | | [JsonProperty(PropertyName = "rules")] |
| 12 | 66 | | public IList<string> Rules { get; set; } |
| | 67 | |
|
| | 68 | | /// <summary> |
| | 69 | | /// Validate the object. |
| | 70 | | /// </summary> |
| | 71 | | /// <exception cref="ValidationException"> |
| | 72 | | /// Thrown if validation fails |
| | 73 | | /// </exception> |
| | 74 | | public override void Validate() |
| | 75 | | { |
| 2 | 76 | | base.Validate(); |
| 2 | 77 | | if (Rules == null) |
| | 78 | | { |
| 0 | 79 | | throw new ValidationException(ValidationRules.CannotBeNull, "Rules"); |
| | 80 | | } |
| 2 | 81 | | } |
| | 82 | | } |
| | 83 | | } |