internal static SnowballTokenFilter DeserializeSnowballTokenFilter(JsonElement element) { SnowballTokenFilterLanguage language = default; string odatatype = default; string name = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("language")) { language = property.Value.GetString().ToSnowballTokenFilterLanguage(); continue; } if (property.NameEquals("@odata.type")) { odatatype = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } } return(new SnowballTokenFilter(odatatype, name, language)); }
public SnowballTokenFilter(SnowballTokenFilterLanguage language, string name) : base(name) { if (name == null) { throw new ArgumentNullException(nameof(name)); } Language = language; ODataType = "#Microsoft.Azure.Search.SnowballTokenFilter"; }
internal SnowballTokenFilter(SnowballTokenFilterLanguage language, string oDataType, string name) : base(oDataType, name) { Language = language; ODataType = "#Microsoft.Azure.Search.SnowballTokenFilter"; }
public static string ToSerialString(this SnowballTokenFilterLanguage value) => value switch {
internal static string ToSerializedValue(this SnowballTokenFilterLanguage value) { switch (value) { case SnowballTokenFilterLanguage.Armenian: return("armenian"); case SnowballTokenFilterLanguage.Basque: return("basque"); case SnowballTokenFilterLanguage.Catalan: return("catalan"); case SnowballTokenFilterLanguage.Danish: return("danish"); case SnowballTokenFilterLanguage.Dutch: return("dutch"); case SnowballTokenFilterLanguage.English: return("english"); case SnowballTokenFilterLanguage.Finnish: return("finnish"); case SnowballTokenFilterLanguage.French: return("french"); case SnowballTokenFilterLanguage.German: return("german"); case SnowballTokenFilterLanguage.German2: return("german2"); case SnowballTokenFilterLanguage.Hungarian: return("hungarian"); case SnowballTokenFilterLanguage.Italian: return("italian"); case SnowballTokenFilterLanguage.Kp: return("kp"); case SnowballTokenFilterLanguage.Lovins: return("lovins"); case SnowballTokenFilterLanguage.Norwegian: return("norwegian"); case SnowballTokenFilterLanguage.Porter: return("porter"); case SnowballTokenFilterLanguage.Portuguese: return("portuguese"); case SnowballTokenFilterLanguage.Romanian: return("romanian"); case SnowballTokenFilterLanguage.Russian: return("russian"); case SnowballTokenFilterLanguage.Spanish: return("spanish"); case SnowballTokenFilterLanguage.Swedish: return("swedish"); case SnowballTokenFilterLanguage.Turkish: return("turkish"); } return(null); }
/// <summary> /// Initializes a new instance of the SnowballTokenFilter class. /// </summary> /// <param name="name">The name of the token filter. It must only /// contain letters, digits, spaces, dashes or underscores, can only /// start and end with alphanumeric characters, and is limited to 128 /// characters.</param> /// <param name="language">The language to use. Possible values /// include: 'armenian', 'basque', 'catalan', 'danish', 'dutch', /// 'english', 'finnish', 'french', 'german', 'german2', 'hungarian', /// 'italian', 'kp', 'lovins', 'norwegian', 'porter', 'portuguese', /// 'romanian', 'russian', 'spanish', 'swedish', 'turkish'</param> public SnowballTokenFilter(string name, SnowballTokenFilterLanguage language) : base(name) { Language = language; CustomInit(); }
internal SnowballTokenFilter(string odataType, string name, SnowballTokenFilterLanguage language) : base(odataType, name) { Language = language; OdataType = odataType ?? "#Microsoft.Azure.Search.SnowballTokenFilter"; }