| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | |
|
| | 10 | | namespace Azure.Search.Documents.Indexes.Models |
| | 11 | | { |
| | 12 | | internal static class TokenCharacterKindExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this TokenCharacterKind value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | TokenCharacterKind.Letter => "letter", |
| 0 | 17 | | TokenCharacterKind.Digit => "digit", |
| 0 | 18 | | TokenCharacterKind.Whitespace => "whitespace", |
| 0 | 19 | | TokenCharacterKind.Punctuation => "punctuation", |
| 0 | 20 | | TokenCharacterKind.Symbol => "symbol", |
| 0 | 21 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TokenCharacterKind value.") |
| 0 | 22 | | }; |
| | 23 | |
|
| | 24 | | public static TokenCharacterKind ToTokenCharacterKind(this string value) |
| | 25 | | { |
| 0 | 26 | | if (string.Equals(value, "letter", StringComparison.InvariantCultureIgnoreCase)) return TokenCharacterKind.L |
| 0 | 27 | | if (string.Equals(value, "digit", StringComparison.InvariantCultureIgnoreCase)) return TokenCharacterKind.Di |
| 0 | 28 | | if (string.Equals(value, "whitespace", StringComparison.InvariantCultureIgnoreCase)) return TokenCharacterKi |
| 0 | 29 | | if (string.Equals(value, "punctuation", StringComparison.InvariantCultureIgnoreCase)) return TokenCharacterK |
| 0 | 30 | | if (string.Equals(value, "symbol", StringComparison.InvariantCultureIgnoreCase)) return TokenCharacterKind.S |
| 0 | 31 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TokenCharacterKind value."); |
| | 32 | | } |
| | 33 | | } |
| | 34 | | } |