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.
Implements
IMessageAnnotatedString, IEquatableAnnotatedString, IDeepCloneableAnnotatedString, IBufferMessage, IMessageNamespace
Google.Cloud.DataQnA.V1AlphaAssembly
Google.Cloud.DataQnA.V1Alpha.dll
Constructors
AnnotatedString()
public AnnotatedString()
AnnotatedString(AnnotatedString)
public AnnotatedString(AnnotatedString other)
Parameter | |
---|---|
Name | Description |
other | AnnotatedString |
Properties
HtmlFormatted
public string HtmlFormatted { get; set; }
HTML version of the string annotation.
Property Value | |
---|---|
Type | Description |
string |
Markups
public RepeatedField<AnnotatedString.Types.SemanticMarkup> Markups { get; }
Semantic version of the string annotation.
Property Value | |
---|---|
Type | Description |
RepeatedFieldAnnotatedStringTypesSemanticMarkup |
TextFormatted
public string TextFormatted { get; set; }
Text version of the string.
Property Value | |
---|---|
Type | Description |
string |