Class AnnotatedString (2.0.0-alpha01)

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

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 = &quot;top countries by population in Africa&quot;

html_formatted = &quot;top &lt;b>countries&lt;/b> by &lt;b>population&lt;/b> in &lt;i>Africa&lt;/i>&quot;

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

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
RepeatedField<AnnotatedString.Types.SemanticMarkup>

TextFormatted

public string TextFormatted { get; set; }

Text version of the string.

Property Value
TypeDescription
String