| | 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 | | /// Decomposes compound words found in many Germanic languages. This token |
| | 21 | | /// filter is implemented using Apache Lucene. |
| | 22 | | /// <see |
| | 23 | | /// href="http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/compound/DictionaryCompou |
| | 24 | | /// /> |
| | 25 | | /// </summary> |
| | 26 | | [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter")] |
| | 27 | | public partial class DictionaryDecompounderTokenFilter : TokenFilter |
| | 28 | | { |
| | 29 | | /// <summary> |
| | 30 | | /// Initializes a new instance of the DictionaryDecompounderTokenFilter |
| | 31 | | /// class. |
| | 32 | | /// </summary> |
| 4 | 33 | | public DictionaryDecompounderTokenFilter() |
| | 34 | | { |
| | 35 | | CustomInit(); |
| 4 | 36 | | } |
| | 37 | |
|
| | 38 | | /// <summary> |
| | 39 | | /// Initializes a new instance of the DictionaryDecompounderTokenFilter |
| | 40 | | /// class. |
| | 41 | | /// </summary> |
| | 42 | | /// <param name="name">The name of the token filter. It must only |
| | 43 | | /// contain letters, digits, spaces, dashes or underscores, can only |
| | 44 | | /// start and end with alphanumeric characters, and is limited to 128 |
| | 45 | | /// characters.</param> |
| | 46 | | /// <param name="wordList">The list of words to match against.</param> |
| | 47 | | /// <param name="minWordSize">The minimum word size. Only words longer |
| | 48 | | /// than this get processed. Default is 5. Maximum is 300.</param> |
| | 49 | | /// <param name="minSubwordSize">The minimum subword size. Only |
| | 50 | | /// subwords longer than this are outputted. Default is 2. Maximum is |
| | 51 | | /// 300.</param> |
| | 52 | | /// <param name="maxSubwordSize">The maximum subword size. Only |
| | 53 | | /// subwords shorter than this are outputted. Default is 15. Maximum is |
| | 54 | | /// 300.</param> |
| | 55 | | /// <param name="onlyLongestMatch">A value indicating whether to add |
| | 56 | | /// only the longest matching subword to the output. Default is |
| | 57 | | /// false.</param> |
| | 58 | | public DictionaryDecompounderTokenFilter(string name, IList<string> wordList, int? minWordSize = default(int?), |
| 6 | 59 | | : base(name) |
| | 60 | | { |
| 6 | 61 | | WordList = wordList; |
| 6 | 62 | | MinWordSize = minWordSize; |
| 6 | 63 | | MinSubwordSize = minSubwordSize; |
| 6 | 64 | | MaxSubwordSize = maxSubwordSize; |
| 6 | 65 | | OnlyLongestMatch = onlyLongestMatch; |
| | 66 | | CustomInit(); |
| 6 | 67 | | } |
| | 68 | |
|
| | 69 | | /// <summary> |
| | 70 | | /// An initialization method that performs custom operations like setting defaults |
| | 71 | | /// </summary> |
| | 72 | | partial void CustomInit(); |
| | 73 | |
|
| | 74 | | /// <summary> |
| | 75 | | /// Gets or sets the list of words to match against. |
| | 76 | | /// </summary> |
| | 77 | | [JsonProperty(PropertyName = "wordList")] |
| 26 | 78 | | public IList<string> WordList { get; set; } |
| | 79 | |
|
| | 80 | | /// <summary> |
| | 81 | | /// Gets or sets the minimum word size. Only words longer than this get |
| | 82 | | /// processed. Default is 5. Maximum is 300. |
| | 83 | | /// </summary> |
| | 84 | | [JsonProperty(PropertyName = "minWordSize")] |
| 26 | 85 | | public int? MinWordSize { get; set; } |
| | 86 | |
|
| | 87 | | /// <summary> |
| | 88 | | /// Gets or sets the minimum subword size. Only subwords longer than |
| | 89 | | /// this are outputted. Default is 2. Maximum is 300. |
| | 90 | | /// </summary> |
| | 91 | | [JsonProperty(PropertyName = "minSubwordSize")] |
| 26 | 92 | | public int? MinSubwordSize { get; set; } |
| | 93 | |
|
| | 94 | | /// <summary> |
| | 95 | | /// Gets or sets the maximum subword size. Only subwords shorter than |
| | 96 | | /// this are outputted. Default is 15. Maximum is 300. |
| | 97 | | /// </summary> |
| | 98 | | [JsonProperty(PropertyName = "maxSubwordSize")] |
| 26 | 99 | | public int? MaxSubwordSize { get; set; } |
| | 100 | |
|
| | 101 | | /// <summary> |
| | 102 | | /// Gets or sets a value indicating whether to add only the longest |
| | 103 | | /// matching subword to the output. Default is false. |
| | 104 | | /// </summary> |
| | 105 | | [JsonProperty(PropertyName = "onlyLongestMatch")] |
| 22 | 106 | | public bool? OnlyLongestMatch { get; set; } |
| | 107 | |
|
| | 108 | | /// <summary> |
| | 109 | | /// Validate the object. |
| | 110 | | /// </summary> |
| | 111 | | /// <exception cref="ValidationException"> |
| | 112 | | /// Thrown if validation fails |
| | 113 | | /// </exception> |
| | 114 | | public override void Validate() |
| | 115 | | { |
| 4 | 116 | | base.Validate(); |
| 4 | 117 | | if (WordList == null) |
| | 118 | | { |
| 0 | 119 | | throw new ValidationException(ValidationRules.CannotBeNull, "WordList"); |
| | 120 | | } |
| 4 | 121 | | if (MinWordSize > 300) |
| | 122 | | { |
| 0 | 123 | | throw new ValidationException(ValidationRules.InclusiveMaximum, "MinWordSize", 300); |
| | 124 | | } |
| 4 | 125 | | if (MinSubwordSize > 300) |
| | 126 | | { |
| 0 | 127 | | throw new ValidationException(ValidationRules.InclusiveMaximum, "MinSubwordSize", 300); |
| | 128 | | } |
| 4 | 129 | | if (MaxSubwordSize > 300) |
| | 130 | | { |
| 0 | 131 | | throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxSubwordSize", 300); |
| | 132 | | } |
| 4 | 133 | | } |
| | 134 | | } |
| | 135 | | } |