internal static TextStyle DeserializeTextStyle(JsonElement element) { TextStyleName name = default; float confidence = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("name")) { name = new TextStyleName(property.Value.GetString()); continue; } if (property.NameEquals("confidence")) { confidence = property.Value.GetSingle(); continue; } } return(new TextStyle(name, confidence)); }
/// <summary> /// Initializes a new instance of the <see cref="FormRecognizer.Models.TextAppearance"/> class. /// </summary> /// <param name="styleName">The text line style name.</param> /// <param name="styleConfidence">Measures the degree of certainty of the recognition result.</param> /// <returns>A new <see cref="FormRecognizer.Models.TextAppearance"/> instance for mocking.</returns> public static TextAppearance TextAppearance(TextStyleName styleName, float styleConfidence) => new TextAppearance(styleName, styleConfidence);
/// <summary> /// Initializes a new instance of <see cref="TextAppearance"/>. This constructor /// is intended to be used for mocking only. /// </summary> internal TextAppearance(TextStyleName styleName, float styleConfidence) { Style = new Style(styleName, styleConfidence); }
/// <summary> /// Initializes a new instance of the <see cref="FormRecognizer.Models.TextStyle"/> class. /// </summary> /// <param name="name">The text line style name.</param> /// <param name="confidence">Measures the degree of certainty of the recognition result.</param> /// <returns>A new <see cref="FormRecognizer.Models.TextStyle"/> instance for mocking.</returns> public static TextStyle TextStyle(TextStyleName name, float confidence) => new TextStyle(name, confidence);