Data QnA v1alpha API - Class AnnotatedString (2.0.0-alpha02)

public sealed class AnnotatedString : IMessage<AnnotatedString>, IEquatable<AnnotatedString>, IDeepCloneable<AnnotatedString>, IBufferMessage, IMessage

Reference documentation and code samples for the Data QnA v1alpha API class AnnotatedString.

Describes string annotation from both semantic and formatting perspectives. Example:

User Query:

top countries by population in Africa

0 4 14 17 28 31 37

Table Data:

  • "country" - dimension
  • "population" - metric
  • "Africa" - value in the "continent" column

text_formatted = "top countries by population in Africa"

html_formatted = "top <b>countries</b> by <b>population</b> in <i>Africa</i>"

markups = [
  {DIMENSION, 4, 12}, // 'countries'
  {METRIC, 17, 26}, // 'population'
  {FILTER, 31, 36}  // 'Africa'
]

Note that html formattings for 'DIMENSION' and 'METRIC' are the same, while semantic markups are different.

Inheritance

object > AnnotatedString

Namespace

Google.Cloud.DataQnA.V1Alpha

Assembly

Google.Cloud.DataQnA.V1Alpha.dll

Constructors

AnnotatedString()

public AnnotatedString()

AnnotatedString(AnnotatedString)

public AnnotatedString(AnnotatedString other)
Parameter
NameDescription
otherAnnotatedString

Properties

HtmlFormatted

public string HtmlFormatted { get; set; }

HTML version of the string annotation.

Property Value
TypeDescription
string

Markups

public RepeatedField<AnnotatedString.Types.SemanticMarkup> Markups { get; }

Semantic version of the string annotation.

Property Value
TypeDescription
RepeatedFieldAnnotatedStringTypesSemanticMarkup

TextFormatted

public string TextFormatted { get; set; }

Text version of the string.

Property Value
TypeDescription
string