| | 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 PhoneticEncoderExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this PhoneticEncoder value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | PhoneticEncoder.Metaphone => "metaphone", |
| 0 | 17 | | PhoneticEncoder.DoubleMetaphone => "doubleMetaphone", |
| 0 | 18 | | PhoneticEncoder.Soundex => "soundex", |
| 0 | 19 | | PhoneticEncoder.RefinedSoundex => "refinedSoundex", |
| 0 | 20 | | PhoneticEncoder.Caverphone1 => "caverphone1", |
| 0 | 21 | | PhoneticEncoder.Caverphone2 => "caverphone2", |
| 0 | 22 | | PhoneticEncoder.Cologne => "cologne", |
| 0 | 23 | | PhoneticEncoder.Nysiis => "nysiis", |
| 0 | 24 | | PhoneticEncoder.KoelnerPhonetik => "koelnerPhonetik", |
| 0 | 25 | | PhoneticEncoder.HaasePhonetik => "haasePhonetik", |
| 0 | 26 | | PhoneticEncoder.BeiderMorse => "beiderMorse", |
| 0 | 27 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PhoneticEncoder value.") |
| 0 | 28 | | }; |
| | 29 | |
|
| | 30 | | public static PhoneticEncoder ToPhoneticEncoder(this string value) |
| | 31 | | { |
| 0 | 32 | | if (string.Equals(value, "metaphone", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncoder.M |
| 0 | 33 | | if (string.Equals(value, "doubleMetaphone", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEnc |
| 0 | 34 | | if (string.Equals(value, "soundex", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncoder.Sou |
| 0 | 35 | | if (string.Equals(value, "refinedSoundex", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEnco |
| 0 | 36 | | if (string.Equals(value, "caverphone1", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncoder |
| 0 | 37 | | if (string.Equals(value, "caverphone2", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncoder |
| 0 | 38 | | if (string.Equals(value, "cologne", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncoder.Col |
| 0 | 39 | | if (string.Equals(value, "nysiis", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncoder.Nysi |
| 0 | 40 | | if (string.Equals(value, "koelnerPhonetik", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEnc |
| 0 | 41 | | if (string.Equals(value, "haasePhonetik", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncod |
| 0 | 42 | | if (string.Equals(value, "beiderMorse", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncoder |
| 0 | 43 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PhoneticEncoder value."); |
| | 44 | | } |
| | 45 | | } |
| | 46 | | } |